Cerena

Will the script be able to continue its job after an automatic restart is forced by a product installer

8 posts in this topic

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,

Share this post


Link to post
Share on other sites



@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.

 


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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

 

 

Share this post


Link to post
Share on other sites

When you search the forum you will find a lot of hits regarding RunOnce.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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\Startup

Although, 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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Then I would use the RunOnce approach.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

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