Jump to content

How can I run a BAT file, reboot & call another?


Recommended Posts

This is for a specialprogram that was written for our office, but it only affects about 30 users (out of 150+). So I want to let the unattended install run its course and install the standard stuff. Then, as the local administrator, I'd run a BAT file that installs the program on an as-needed basis.

Makes sense, right? Here's the problem -- there was a critical update patch that we were given a few days ago. If I include it in the same BAT file, the program ends up not working. This patch will only work if there is a reboot after the initial installation of the program itself.

I hope I'm still making sense. Now, I could write a second BAT file for the patch and run that after a reboot, but I'd like to avoid that if I could. Is there a way that I can be logged onto the PC as the local administrator, run a BAT file, force a reboot after the BAT file ends, have it auto-login as the administrator after the reboot, and automatically call a second BAT file? (but not necessarily force a second reboot)

Is that doable? Or am I over-reaching?

Link to comment
Share on other sites


how about copying the second batchfile into the startup-folder of the startmenu? just let the batch delete itself when its finished to prevent loading it again and again you start the system.

Link to comment
Share on other sites

Yes, that's possible. Make the first batch file copy the second batch file to the Startup folder and then delete itself, like eirogge said. Use the the command shutdown.exe -r -f -t 90 to reboot the computer at the end of the first batch file.

Link to comment
Share on other sites

Why not have the first batch file add a GuiRunOnce command to load the second batch file (it will load it after a reboot automatically)?

that way you don't have to worry about copying it to the startup folder and deleting it once its been run

and of course use the shutdown command to reboot the pc...

Use the same format as the apps.cmd that installs all your programs (REG ADD)...

Link to comment
Share on other sites

OcTroN and Crusher:

Neither of those would work for me, because this is something that only applies to about 20% of my workstations. It sounds like those methods would apply the installatin to every workstation.

I've considered creating different unattended setups for different applications, but that would be too much of a pain. I'd prefer to just run the same unattended on every workstation, then go from there.

Thanks anyway!

:)

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
  • Recently Browsing   0 members

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