Jump to content

How to automatically continue execution of other scripts after reboot


Recommended Posts

I have finished coding scripts for my many applications...however i noticed that some need a restart and when this happens the script will have to continue with the remainder of installations. How is this achievable in autoit...i cant seem to find any clue even in the help manual...

Link to comment
Share on other sites

I have finished coding scripts for my many applications...however i noticed that some need a restart and when this happens the script will have to continue with the remainder of installations. How is this achievable in autoit...i cant seem to find any clue even in the help manual...

My idea:

Call your Install-script with all applications to install as commandline parameter.

Before you restart, write the call with paramter of the rest into registry (RunOnce).

Another way, instead cmdline-parameter, a file with all applications will used by your script. Before restart you delete all always installed apps from this file.

Best Regards BugFix  

Link to comment
Share on other sites

I have finished coding scripts for my many applications...however i noticed that some need a restart and when this happens the script will have to continue with the remainder of installations. How is this achievable in autoit...i cant seem to find any clue even in the help manual...

I create an INI file with any information needed to continue the script, including variable values and a value I call "phase" that lets me know what stage my script is in (some of my scripts require 2-3 reboots). When everything is done, I set my "phase" to 0 so I know if the script gets run again, that it is finished and I don't need to do anything more.

I will usually also create a link in the startup folder that points to my script, and setup autologin. I delete the startup link and remove autologin when I go to "phase = 0".

If you do use autologin, be wary of who has access to the machine before the autologin is removed.

Hope that wasn't too cryptic an answer.

Link to comment
Share on other sites

I have finished coding scripts for my many applications...however i noticed that some need a restart and when this happens the script will have to continue with the remainder of installations. How is this achievable in autoit...i cant seem to find any clue even in the help manual...

You can create a Windows Scheduler Task for the Script which the operating system will launched based on a system event you choose. Setting up a Scheduler Tasks is in Start/Control Panel/Administration Tools/Task Scheduler/Task Scheduler Library. In the Dropdown Menu Create a task... Give it a simple name no spaces then work through the General, Triggers, Actions

[this is where the path for your script goes], Conditions, Settings for the Task you have just created. Use the RUN option to test that it works.

Then;

If you script requires a reboot before continuing before the reboot the Script can set a status flag and write the value away to an INI file then when the script is re-launched it can read the status of the flag to determine how processing is to continue. Should you so choose you could write a status flag to a Registry item you have created for that purpose and like the INI file

you can then read its value.

I hope that this provides you with some guidance.

Ant.. Posted Image

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...