jronex Posted May 22, 2006 Share Posted May 22, 2006 Was wondering if there was a good way to continue running a autoit script after reboot. My initial thought was to call and load my script in stages and put it in the startup folder in windows and at the final stage del the script from the startup folder. The application i'm trying to automated the installation for requires for 3 reboots. Any ideas would be appreciated, TIA!! Link to comment Share on other sites More sharing options...
Valuater Posted May 22, 2006 Share Posted May 22, 2006 place place it in the startup folder have it write to a file task 1 complete task 2 complete when started ... it reads the file and knows whats next 8) Link to comment Share on other sites More sharing options...
rakudave Posted May 22, 2006 Share Posted May 22, 2006 hmm, it depends on the app you'd like to install, but can't you "delay" the reboot? or just don't close the last install-window, leave it open 'till you're done... Pangaea Ruler new, UDF: _GUICtrlCreateContainer(), Pangaea Desktops, Pangaea Notepad, SuDoku, UDF: Table Link to comment Share on other sites More sharing options...
JSThePatriot Posted May 22, 2006 Share Posted May 22, 2006 hmm, it depends on the app you'd like to install, but can't you "delay" the reboot?or just don't close the last install-window, leave it open 'till you're done...Not if he is automating the clicks of an install process that wont startup again until next reboot. 3 times. JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Developers Jos Posted May 22, 2006 Developers Share Posted May 22, 2006 here is a model script I use for installs that take multiple reboots and requier elevated rights: expandcollapse popup; pgm name DEMO.AU3 $Userid = "Administrator" $Psw = "adminpsw" ; Remove autologin params from registry to clean up SetAutoLogon("Off", "") ; ; retrieve param $param1 = "" If $CmdLine[0] > 0 Then $param1 = $CmdLine[1] EndIf ; Act on it Select Case $param1 = "" ; run your programs with admin account if needed in the first step RunAsSet($Userid, @ComputerName, $Psw) ; ; *** put your stuff here for step1 *** RunWait("notepad.exe step1.txt") ; SetAutoLogon("On", "step1") Shutdown(6) Case $param1 = "step1" ; is already logged on with admin account ; ; *** put your stuff here for step2 *** RunWait("notepad.exe step2.txt") ; SetAutoLogon("On", "step2") Shutdown(6) Case $param1 = "step2" ; logoff the admin account ; *** put your stuff here for step3 *** RunWait("notepad.exe step3.txt") ; just logoff Shutdown(0) Exit EndSelect Exit ; ; Func SetAutoLogon($sw, $step) If $sw = "On" Then ; set the registry to start this program again after reboot RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RUN", "Demo", "REG_SZ", @ScriptFullPath & " " & $step) RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\", "AutoAdminLogon", "REG_SZ", "1") RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\", "DefaultDomainName", "REG_SZ", EnvGet("LOGONSERVER")) RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\", "DefaultUserName", "REG_SZ", $Userid) RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\", "DefaultPassword", "REG_SZ", $Psw) EndIf ; If $sw = "Off" Then ; Remove the registrykey to start this program again after reboot RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RUN", "Demo") RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\", "AutoAdminLogon", "REG_SZ", " ") RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\", "DefaultDomainName", "REG_SZ", " ") RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\", "DefaultUserName", "REG_SZ", " ") RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\", "DefaultPassword", "REG_SZ", " ") EndIf EndFunc ;==>SetAutoLogon notime 1 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...
Valuater Posted May 22, 2006 Share Posted May 22, 2006 hmm, it depends on the app you'd like to install, but can't you "delay" the reboot?or just don't close the last install-window, leave it open 'till you're done...i really dont know, it depends on the program you are installing and what it does...but either way... thats not a good ideamy suggestion could work for this8) Link to comment Share on other sites More sharing options...
jronex Posted May 22, 2006 Author Share Posted May 22, 2006 installing MSDE so it requires a reboot for the next part of the installation. otherwise i would do what you suggested and close the other windows hmm, it depends on the app you'd like to install, but can't you "delay" the reboot?or just don't close the last install-window, leave it open 'till you're done... Link to comment Share on other sites More sharing options...
jronex Posted May 22, 2006 Author Share Posted May 22, 2006 (edited) awwwsooome i will try this..... and gets me pointed in the right direction . Thanks again for your feedback Edited May 22, 2006 by jronex Link to comment Share on other sites More sharing options...
jronex Posted June 14, 2006 Author Share Posted June 14, 2006 Below is the code that i modified to try to do reboots, but what is happening is that it try's to write to the appropriate step1.txt file and then fails to write file but able to do the reboot and does not continue script after reboot. thanks, expandcollapse popup;Main $Userid = "user" $psw = "password"; SetAutologon("Off","") ;retrieve parameters $param1="" IF $CmdLine[0] > 0 Then $param1=$CmdLine[1] EndIf ;Act on it Select Case $param1 = "" ;RunAsSet ($Userid, @ComputerName, $psw) ;This calls the first stip of the instllation; IE 6 Installation Run("\\10.140.66.63\production scripts\PFAMcinstallpart1.exe", "\\10.140.66.63\production scripts\") ;I'm using notepad here as a pointer for the program RunWait("notepad.exe step1.txt") SetAutologon("On","step1") Shutdown(6) Case $param1="step1" ;This calls the 2nd step of the installation; Java,dot.net fix, and MSDE Installation Run("\\10.140.66.63\production scripts\PFAMcinstallpart2.exe", "\\10.140.66.63\production scripts\") Runwait("notepad.exe step2.txt") SetAutologon("On","Step2") Shutdown(6) Case $param1="step2" ;This calls the 3rd step of the installation; Mobile Client Installation Run("\\10.140.66.63\production scripts\part3.exe", "\\10.140.66.63\production scripts\") RunWait("notepad.exe step3.txt") SetAutologon("On","step3") Shutdown(6) Case $param1="step3" ;This calls the 4th step of the installation: Mobile Notes Upgrade Installation Run("\\10.140.66.63\production scripts\partiv.exe", "\\10.140.66.63\production scripts\") RunWait("notepad.exe step4.txt") SetAutologon("On","step4") Shutdown(6) Case $param1="step4" ;This calls the 5th step of the installation;Regserv Part Run("\\10.140.66.63\production scripts\partvi.exe", "\\10.140.66.63\production scripts\") RunWait("notepad.exe step5.txt") SetAutologon("On","step5") Shutdown(6) Case $param1="step5" ;This calls the 6th step of the installation;SigPad Installation Run("\\10.140.66.63\production scripts\partvii.exe", "\\10.140.66.63\production scripts\") RunWait("notepad.exe step6.txt") ;just log off Exit EndSelect Func SetAutologon($sw, $step) if $sw = "On" Then ; set the registry to start this program again after reboot RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","automationscript","REG_SZ", @ScriptFullPath & "" & $step) ;setting the registry for autoadminlogin key to 1 for true RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Winlogon\", "AutoAdminLogon","REG_SZ","1") ;setting the registry for to default to the local domain name RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\", "DefaultDomainName", "REG_SZ", EnvGet("LOGONSERVER") ;settting the registry for the default user id RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows_NT\CurrentVersion\Winlogon\", "DefaultUserName", "REG_SZ", $Userid) ;setting the registry for the default password RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows_NT\CurrentVersion\Winlogon\", "DefaultPassword", "REG_SZ", $psw) EndIf ; If $sw = "Off" Then ;Remove the registrykey to start this program again after reboot RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","automationscript") ;setting the registry for autoadminlogin key to 1 for true RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Winlogon\", "AutoAdminLogon","REG_SZ","") ;settting the registry for the default user id RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows_NT\CurrentVersion\Winlogon\", "DefaultUserName", "REG_SZ", "") ;setting the registry for the default password RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows_NT\CurrentVersion\Winlogon\", "DefaultPassword", "REG_SZ", "") EndIf EndFunc; Link to comment Share on other sites More sharing options...
Developers Jos Posted June 14, 2006 Developers Share Posted June 14, 2006 (edited) is this code on one line ?? ; set the registry to start this program again after reboot RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","automationscript","REG_SZ", @ScriptFullPath & "" & $step)oÝ÷ ÚÈhºW[{ibë(élzØ^®éâ²}ý¶Çjëh×6 ; set the registry to start this program again after reboot RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","automationscript","REG_SZ", @ScriptFullPath & "" & $step) Edited June 14, 2006 by JdeB 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...
jronex Posted June 16, 2006 Author Share Posted June 16, 2006 Not sure what you mean but it's a registry delet command and not a run command?? is this code on one line ?? ; set the registry to start this program again after reboot RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","automationscript","REG_SZ", @ScriptFullPath & "" & $step)oÝ÷ ÚÈhºW[{ibë(élzØ^®éâ²}ý¶Çjëh×6 ; set the registry to start this program again after reboot RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","automationscript","REG_SZ", @ScriptFullPath & "" & $step) Link to comment Share on other sites More sharing options...
jronex Posted June 16, 2006 Author Share Posted June 16, 2006 ohh i see now, what you mean; it is 2 lines the ; is not affecting the command .. sorry!Not sure what you mean but it's a registry delet command and not a run command?? Link to comment Share on other sites More sharing options...
Developers Jos Posted June 16, 2006 Developers Share Posted June 16, 2006 Not sure what you mean but it's a registry delet command and not a run command??No idea what you mean... but in your posted code the RegWrite is behind a comment in stead on a seperate line....Maybe you can attach the script so i can verify if it is correct ... 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...
Briegel Posted June 16, 2006 Share Posted June 16, 2006 Below is the code that i modified to try to do reboots, but what is happening is that it try's to write to the appropriate step1.txt file and then fails to write file but able to do the reboot and does not continue script after reboot.Another way is to split your script.1. run Script1 -> write regkey to start script2 and autologon -> reboot2. run Script2 -> ... Link to comment Share on other sites More sharing options...
jronex Posted June 16, 2006 Author Share Posted June 16, 2006 below is the code , expandcollapse popup; $Userid = "user" $psw = "password1";fake psw SetAutologon("Off","") ;retrieve parameters $param1="" IF $CmdLine[0] > 0 Then $param1=$CmdLine[1] EndIf ;Act on it Select Case $param1 = "" ;RunAsSet ($Userid, @ComputerName, $psw) ;This calls the first stip of the instllation; IE 6 Installation Run("\\10.140.66.63\production scripts\PFAMcinstallpart1.exe", "\\10.140.66.63\production scripts\") ;I'm using notepad here as a pointer for the program RunWait("notepad.exe step1.txt") SetAutologon("On","step1") Shutdown(6) Case $param1="step1" ;This calls the 2nd step of the installation; Java,dot.net fix, and MSDE Installation Run("\\10.140.66.63\production scripts\PFAMcinstallpart2.exe", "\\10.140.66.63\production scripts\") Runwait("notepad.exe step2.txt") SetAutologon("On","Step2") Shutdown(6) Case $param1="step2" ;This calls the 3rd step of the installation; Mobile Client Installation Run("\\10.140.66.63\production scripts\part3.exe", "\\10.140.66.63\production scripts\") RunWait("notepad.exe step3.txt") SetAutologon("On","step3") Shutdown(6) Case $param1="step3" ;This calls the 4th step of the installation: Mobile Notes Upgrade Installation Run("\\10.140.66.63\production scripts\partiv.exe", "\\10.140.66.63\production scripts\") RunWait("notepad.exe step4.txt") SetAutologon("On","step4") Shutdown(6) Case $param1="step4" ;This calls the 5th step of the installation;Regserv Part Run("\\10.140.66.63\production scripts\partvi.exe", "\\10.140.66.63\production scripts\") RunWait("notepad.exe step5.txt") SetAutologon("On","step5") Shutdown(6) Case $param1="step5" ;This calls the 6th step of the installation;SigPad Installation Run("\\10.140.66.63\production scripts\partvii.exe", "\\10.140.66.63\production scripts\") RunWait("notepad.exe step6.txt") ;just log off Exit EndSelect Func SetAutologon($sw, $step) #comments-start************************************************** This section of the code sets the autologing paramameters. #comments-end**************************************************** if $sw = "On" Then ; set the registry to start this program again after reboot RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","automationscript","REG_SZ", @ScriptFullPath & "" & $step) ;setting the registry for autoadminlogin key to 1 for true RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Winlogon\", "AutoAdminLogon","REG_SZ","1") ;setting the registry for to default to the local domain name RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\", "DefaultDomainName", "REG_SZ", EnvGet("LOGONSERVER") ;settting the registry for the default user id RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows_NT\CurrentVersion\Winlogon\", "DefaultUserName", "REG_SZ", $Userid) ;setting the registry for the default password RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows_NT\CurrentVersion\Winlogon\", "DefaultPassword", "REG_SZ", $psw) EndIf ; #comments-start************************************************** This section of the code removes the autologing paramameters. #comments-end**************************************************** If $sw = "Off" Then ;Remove the registrykey to start this program again after reboot RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","automationscript") ;setting the registry for autoadminlogin key to 1 for true RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Winlogon\", "AutoAdminLogon","REG_SZ","") ;settting the registry for the default user id RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows_NT\CurrentVersion\Winlogon\", "DefaultUserName", "REG_SZ", "") ;setting the registry for the default password RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows_NT\CurrentVersion\Winlogon\", "DefaultPassword", "REG_SZ", "") EndIf EndFunc; Link to comment Share on other sites More sharing options...
Developers Jos Posted June 16, 2006 Developers Share Posted June 16, 2006 there is a space missing in the command to run:@ScriptFullPath & " " & $step 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...
jronex Posted June 16, 2006 Author Share Posted June 16, 2006 can you give me an example of how that script wiil look so i'm guessing i would just split my script and add the following code RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","script2.exre","REG_SZ", @ScriptFullPath); Another way is to split your script. 1. run Script1 -> write regkey to start script2 and autologon -> reboot 2. run Script2 -> ... Link to comment Share on other sites More sharing options...
Briegel Posted June 16, 2006 Share Posted June 16, 2006 can you give me an example of how that script wiil look so i'm guessing i would just split my script and add the following code RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","script2.exre","REG_SZ", @ScriptFullPath); Yes that's all. If you want to autologon after reboot, write the keys RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","AutoAdminLogon|DefaultDomainName|DefaultPassword|DefaultUserName","REG_SZ", "1|Domain|Password|UserName") 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