Jump to content
Sign in to follow this  
dcallaghan

Startup script problem

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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)


NEWHeader1.png

Share this post


Link to post
Share on other sites

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)

enjoy!  8)

<{POST_SNAPBACK}>

Hi

Thanks. 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 regards

David Callaghan

Share this post


Link to post
Share on other sites

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 Exit

AutoItWinSetTitle( $ScriptTitle )

Opt("TrayIconHide", 1) ; suppress system tray icon

RunAsSet("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_Addr

Else

$cmdline = $IExplore & " " & $Serv_Launch_Addr

EndIf

;MsgBox(0,"", "cmdline=" & $cmdline)

RunWait( $cmdline, "", @SW_MAXIMIZE )

;MsgBox(0,"", "After Launch RunWait" & $cmdline)

If $User = "OPERATOR" Then

Shutdown(1)

EndIf

; Reset user's permissions

RunAsSet()

Edited by dcallaghan

Share this post


Link to post
Share on other sites

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 ERROR

Line 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 running

If I log off the machine and then back on it works every time.

Many thanks for your help

Share this post


Link to post
Share on other sites

ERROR: Unable to execute the external program.

An instance of the service is already running

Anyone got an idea what service this error is talking about?

Many thanks!

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

<{POST_SNAPBACK}>

Hi Burrup

Thanks - 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 regards

David Callaghan

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...