Cerena Posted December 8, 2015 Posted December 8, 2015 I would need to install a product and the product forces the system to do a restart. But even after the restart there are some steps that should be automated. Is it possible for the script to handle the restart and then continue with the other steps. Thank you,
Moderators JLogan3o13 Posted December 8, 2015 Moderators Posted December 8, 2015 @Cerena there are a number of ways to do this, yes. It is probably easiest to drop a small file onto the machine, so the script knows where it left off. When you launch your script, always have it check for the existence of that file; if not there, start at the beginning, otherwise begin at "stage 2", etc. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
water Posted December 8, 2015 Posted December 8, 2015 Should the script automatically be started after reboot or do you just need to know if it was started before or after the reboot? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
MilesAhead Posted December 8, 2015 Posted December 8, 2015 Your program can write to the RunOnce Registry key to start on the next boot. You could have the command line include a switch to make it easy to know it was started via RunOnce. It is pretty easy to use. Plus it is automatically removed by the system. No need to delete the key manually. https://msdn.microsoft.com/en-us/library/windows/desktop/aa376977(v=vs.85).aspx?f=255&MSPPError=-2147217396 My Freeware Page
water Posted December 8, 2015 Posted December 8, 2015 When you search the forum you will find a lot of hits regarding RunOnce. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
jdelaney Posted December 9, 2015 Posted December 9, 2015 Make everything idempotent, and you don't need to worry where you start the script from...such as validate the registry values added by your installer are already present, or install it.Another way to autostart it is to copy it into the startup folder (make sure to delete it when your script reaches the end completion:C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartupAlthough, the startup requires someone to login. Another way is to create a scheduled task that runs on startup. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Cerena Posted December 9, 2015 Author Posted December 9, 2015 Should the script automatically be started after reboot or do you just need to know if it was started before or after the reboot?Script should be started automatically after reboot
water Posted December 9, 2015 Posted December 9, 2015 Then I would use the RunOnce approach. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
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