dcallaghan Posted June 9, 2005 Share Posted June 9, 2005 I have a script in AutoIT3 that runs from the Startup folder when some of our systems boot in a limited user accout on XP. The script launches a program as Administrator. 75% of the time we get a message at boot saying 'AutoIT is already running' (or similar), even though it is only run from the limited user account Startup. This doesn't happen all of the time however. I have modified the script to check for other instances of the same script but it still occurs. The systems are not local to me and I cannot replicate the problem here. Anyone got a clue what is going on. Link to comment Share on other sites More sharing options...
Valuater Posted June 9, 2005 Share Posted June 9, 2005 with my limiyed wisdom....... there are separate start-up folders all users, administrator, john doe, etc if you only want one instance of your program i use this ; check if process already exists $g_szVersion = "My XP Cleaner" If WinExists($g_szVersion) Then MouseMove(500,5) MsgBox(64, "* NOTE * ", "*XPClean Menu* was already running ", 5) SoundPlay ($Sound_lnk,1) Exit ; It's already running EndIf AutoItWinSetTitle($g_szVersion) if you want to have multiple instances with a choice i would do this ; check if process already exists $g_szVersion = "My XP Cleaner" If WinExists($g_szVersion) Then MsgBox(68, "* NOTE * ", "*XPClean Menu* was already running " & @CRLF & " Would you like to use a Second instance of *XPClean Menu?", 5) yes= $g_szVersion = "My XP Cleaner 2" ;and run the program no= exit EndIf AutoItWinSetTitle($g_szVersion) Just some ideas you could do thi as many times as you want enjoy! 8) Link to comment Share on other sites More sharing options...
dcallaghan Posted June 9, 2005 Author Share Posted June 9, 2005 with my limiyed wisdom.......there are separate start-up foldersall users, administrator, john doe, etcif you only want one instance of your program i use this; check if process already exists$g_szVersion = "My XP Cleaner"If WinExists($g_szVersion) Then MouseMove(500,5) MsgBox(64, "* NOTE * ", "*XPClean Menu* was already running ", 5) SoundPlay ($Sound_lnk,1) Exit ; It's already runningEndIfAutoItWinSetTitle($g_szVersion)enjoy! 8)<{POST_SNAPBACK}>HiThanks. I am already doing this and it is still happening. The only startup group with a shortcut to the AutoIT script is for the single user. If I log on as any other user, it doesn't run at all.Best regardsDavid Callaghan Link to comment Share on other sites More sharing options...
dcallaghan Posted June 9, 2005 Author Share Posted June 9, 2005 (edited) Does the script launch an AutoIt compiled script?Lar.<{POST_SNAPBACK}>There is a single compiled script on the system called from a shortcut in the users startup folder. AutoIT itself is not on installed on the system.Here is the script:; ensure only one script can run at a time$ScriptTitle = "Startup Script 2.0"If WinExists( $ScriptTitle ) Then ExitAutoItWinSetTitle( $ScriptTitle )Opt("TrayIconHide", 1) ; suppress system tray iconRunAsSet("Administrator", @Computername, "passw0rd")$User = StringUpper(@UserName)$Serv_Launch_Addr = IniRead("PalletTrackDiags.ini", "main", "ServerLaunchAddress", "https://hidden.onpurpose.com")$Serv_Kiosk_Mode = IniRead("PalletTrackDiags.ini", "main", "ServerLaunchKiosk", "1")$IExplore = IniRead("PalletTrackDiags.ini", "main", "IExplore", "IExplore")RunWait("C:\Program Files\Pallet Track Diagnostics\PalletTrackDiags.exe", "C:\Program Files\Pallet Track Diagnostics", @SW_MAXIMIZE )if $Serv_Kiosk_Mode = "1" Then $cmdline = $IExplore & " -k " & $Serv_Launch_AddrElse $cmdline = $IExplore & " " & $Serv_Launch_AddrEndIf;MsgBox(0,"", "cmdline=" & $cmdline)RunWait( $cmdline, "", @SW_MAXIMIZE );MsgBox(0,"", "After Launch RunWait" & $cmdline)If $User = "OPERATOR" Then Shutdown(1)EndIf; Reset user's permissionsRunAsSet() Edited June 9, 2005 by dcallaghan Link to comment Share on other sites More sharing options...
dcallaghan Posted June 21, 2005 Author Share Posted June 21, 2005 Is this...'AutoIT is already running'coming from the program or the OS? Basically, where is this message coming from...Lar.<{POST_SNAPBACK}>Hi We are getting the following error message:AUTOIT ERRORLine RunWait("C:\Program Files\Pallet Track Diagnostics\PalletTrackDiags.exe", "C:\Program Files\Pallet Track Diagnostics", @SW_MAXIMIZE )ERROR: Unable to execute the external program.An instance of the service is already runningIf I log off the machine and then back on it works every time.Many thanks for your help Link to comment Share on other sites More sharing options...
dcallaghan Posted June 23, 2005 Author Share Posted June 23, 2005 ERROR: Unable to execute the external program.An instance of the service is already runningAnyone got an idea what service this error is talking about?Many thanks! Link to comment Share on other sites More sharing options...
buzz44 Posted June 23, 2005 Share Posted June 23, 2005 That is an AutoIt error. I don't really know alot about services but it looks to me you can only have one instance of the service running at once, which means that your error is caused because the service is already running. Maybe try... If Not ProcessExists("PalletTrackDiags.exe") Then RunWait("C:\Program Files\Pallet Track Diagnostics\PalletTrackDiags.exe", "C:\Program Files\Pallet Track Diagnostics", @SW_MAXIMIZE ) EndIf Of course all the above is based on assumption. qq Link to comment Share on other sites More sharing options...
HardCopy Posted June 23, 2005 Share Posted June 23, 2005 Anyone got an idea what service this error is talking about?Many thanks!<{POST_SNAPBACK}>Look in Windows System Event Viewer/Services and see if it givess u anymore info in the log file.HardCopy Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad Link to comment Share on other sites More sharing options...
dcallaghan Posted June 28, 2005 Author Share Posted June 28, 2005 That is an AutoIt error. I don't really know alot about services but it looks to me you can only have one instance of the service running at once, which means that your error is caused because the service is already running. Maybe try...If Not ProcessExists("PalletTrackDiags.exe") Then RunWait("C:\Program Files\Pallet Track Diagnostics\PalletTrackDiags.exe", "C:\Program Files\Pallet Track Diagnostics", @SW_MAXIMIZE ) EndIfOf course all the above is based on assumption.<{POST_SNAPBACK}>Hi BurrupThanks - I will give that a try, even though PalletTrackDiags.exe is not a service and only allows a single instance of itself anyway. Maybe it is a terminology thing.Now the question is... Why didn't I try that myself!!!Kind regardsDavid Callaghan 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