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.
Looking for a function
Started by
ondrajka
, Jun 01 2009 01:06 PM
3 replies to this topic
#1
Posted 01 June 2009 - 01:06 PM
#2
Posted 01 June 2009 - 01:13 PM
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.
Visit the SciTE4AutoIt3 Download page for the latest versions Forum Rules
Live for the present,
Dream of the future,
Learn from the past.
#3
Posted 01 June 2009 - 01:21 PM
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
#4
Posted 01 June 2009 - 02:07 PM
check this out!
AutoIt
#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
Attached Files
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
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users






