ondrajka Posted June 1, 2009 Share Posted June 1, 2009 I've tried help and the forums but don't quite know what I'm looking for so it's hard to search. Looking for something similar to If ProcessExists ("whatever.exe") Then $a=1 Only for a script i.e. If ScriptExists ("scriptname.au3") Then $a=1 I can't use ProcessExists because all au3 have the same process name. Link to comment Share on other sites More sharing options...
Developers Jos Posted June 1, 2009 Developers Share Posted June 1, 2009 Not sure why different scripts have the same EXE name but you could use a unique name with _Singleton() in each script you run and then test for that sOccurenceName in your script. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
ProgAndy Posted June 1, 2009 Share Posted June 1, 2009 You should compile your scripts to exe *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
rajeshontheweb Posted June 1, 2009 Share Posted June 1, 2009 check this out! expandcollapse popup#include <process.au3> #include <_WinAPI_GetCommandLine.au3> ; got this from this forum here... #region example ConsoleWrite(_IsScriptRunning(@ScriptName)) #endregion Func _IsScriptRunning($ScriptName) Local $retVal = -1 $AutoITProcesses = _GetAutoitScripts() If $AutoITProcesses[0][0] > 0 Then For $i = 0 to $AutoITProcesses[0][0] If StringInStr($AutoITProcesses[$i][1],$ScriptName) Then $retVal = 1 Next Else $retVal = 2 SetExtended("Autoit Process Not Found Running?") EndIf Return $retVal EndFunc Func _GetAutoitScripts() ; Script Name only not full path please. Local $AutoItEXE = _ProcessGetName(@AutoItPID) Local $ProcessList = ProcessList() Local $procAutoIT[1][3] For $i = 0 to $ProcessList[0][0] If $ProcessList[$i][0] = $AutoItEXE Then ReDim $procAutoIT[Ubound($procAutoIT)+1][3] $procAutoIT[Ubound($procAutoIT)-1][0] = $ProcessList[$i][1] $procAutoIT[Ubound($procAutoIT)-1][1] = _WinAPI_GetCommandLineFromPID($ProcessList[$i][1]) ;~ $procAutoIT[$i][2] = EndIf Next $procAutoIT[0][0] = UBound($procAutoIT)-1 Return $procAutoIT EndFunc_WinAPI_GetCommandLine.au3_IsScriptRunning.au3 Started late is much better than having never started it!!!!Failure is another step towards success. I've been messing around with: Adding Entry to 'Hosts'File Information Lister (Logger)Yet Another AutoIT Error Handler Yet Another AutoIT Error Handler & Debugger Control your App's TaskBar Button YCurrency Ticker (Latest Release : 16 Apr 2009)_WinInetInternetCheckConnection UDF Symantec Definitions Lister UDF _GetLocalIPAddresses UDF UDF to get Special Folder Information WMI_NetworkAdapterConfiguration2Array WMI_CDRomDriveCapabilities _ScriptExists - Check if your au3 script is running!! Uninstaller UDF Get Version for your application (at script level or compiled stage) Uninstaller Pro - faster alternative to windows application removal applet Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now