dcallaghan Posted January 19, 2005 Share Posted January 19, 2005 (edited) I have a script that runs from a shortcut in the Startup folder. The script is locating in C:\Program Files\Diagnostics The machine is locked down, and the script runs a diagnostic program as the system administrator at machine boot. Usually, but not always, the script reports that is already running. I have checked that the script is only running from one place - IE only launched a single time. If I bring the PC back here, it works every time!?! If the script fails, logging off and back on as the same user makes the script always work. This is the script: RunAsSet("Administrator", @Computername, "password") $User = StringUpper(@UserName) $Serv_Launch_Addr = IniRead("Diags.ini", "main", "ServerLaunchAddress", "https://xxx.com") $Serv_Kiosk_Mode = IniRead("Diags.ini", "main", "ServerLaunchKiosk", "1") $IExplore = IniRead("Diags.ini", "main", "IExplore", "IExplore") RunWait("C:\Program Files\Diagnostics\Diags.exe", "C:\Program Files\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 January 19, 2005 by dcallaghan 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