Jump to content

How To Automate A Reboot At First Logon?


Recommended Posts

Ok guys here is the situation...

I have made a XP Pro unattended DVD (due to the large amount of drivers in it) now it uses the driverpacks from driverpacks.net (thanks for these guys) and it also runs the WPI too. The problem I have is that the WPI installs NOD32 v2.7 but it requires a reboot after installing.

Once the desktop is shown is there a way to intergrate a command into the setup which will run the reboot command once the desktop has loaded?

Thank you in advance ;)

Stoner81 :thumbup

Link to comment
Share on other sites


here's a kind of fail safe way

Open notepad enter copy paste following text into it:

Start ShutDown /R /F /T 120

del /F /q "%allusersprofile%\start menu\programs\start up\shutdown.bat"

save it as shutdown.bat and copy it into

your $oem$ folder and corresponding directory, cant remember path atm, but check msfn guide to unattended and find that $oem$ section, im sure somebody has it in their head.

Please check it with something else then shutdown command so you are sure the file will auto delete itself.

I use these kind of batch file approaches for a few things and works great.

Link to comment
Share on other sites

here's a kind of fail safe way

Open notepad enter copy paste following text into it:

Start ShutDown /R /F /T 120

del /F /q "%allusersprofile%\start menu\programs\start up\shutdown.bat"

save it as shutdown.bat and copy it into

your $oem$ folder and corresponding directory, cant remember path atm, but check msfn guide to unattended and find that $oem$ section, im sure somebody has it in their head.

Please check it with something else then shutdown command so you are sure the file will auto delete itself.

I use these kind of batch file approaches for a few things and works great.

DUDE!!!!! Thank you so much for your quick response on this matter it has been driving me up the wall!!!! I will test it on and report back on what happens thanks again!!!!

I think it just goes into the $OEM$ folder with no sub directory but i can't seem to find anything else to say otherwise????

Stoner81 :thumbup:

Edited by Stoner81
Link to comment
Share on other sites

Ah ha!! i think i have it sorted out now though still a little niggle is that the driverpacks finisher does not stat until after the WPI which is run from the $OEM$ folder in the commands.txt file so if i add this shutdown to it if i dont get the timing right the machine will shutdown and reboot before the driverpack finisher has finished.

But still thanks for the help very much appreciated :thumbup:

Stoner81

EDIT - i see now its due to the $OEM$ it copies it to the HHD i think the folder is $DOCS but not sure where to go from here.

Edited by Stoner81
Link to comment
Share on other sites

okay just give me some seconds...

Click me for reference

$Docs - Documents and Settings

$Progs - Program Files

$$ - Windows Folder

$1 - Root of hard drive where Windows is installed to partition.

Textmode - Mass storage drivers and HAL files required during the text-mode portion of Setup.

drive_letter - Represents the root of a particular volume on the system (e.g., \$OEM$\C represents the C: drive) and contains any files that WinXP Setup should copy to this partition during installation.

So use a path of

$OEM$\$Docs\All users\Start Menu\Programs\Startup\

on your windows source folder on your harddrive ok which is what you of course burn as your windows install image.

I think %allusersprofile%\start menu\programs\start up\shutdown.bat" is correct as i wrote previously

but here's a heads up : some variables dont allow the " \ " directly after it, (slash symbol) %examplevariable%\test\example.exe and instead use it without so it becomes %examplevariable%test\example.exe (note the second \ is correct anyway(of course))

Please let me know what works for you, and copy&paste it back here, so others can also benefit.

Thanks.

Edited by TranceEnergy
Link to comment
Share on other sites

okay just give me some seconds...

Click me for reference

$Docs - Documents and Settings

$Progs - Program Files

$$ - Windows Folder

$1 - Root of hard drive where Windows is installed to partition.

Textmode - Mass storage drivers and HAL files required during the text-mode portion of Setup.

drive_letter - Represents the root of a particular volume on the system (e.g., \$OEM$\C represents the C: drive) and contains any files that WinXP Setup should copy to this partition during installation.

So use a path of

$OEM$\$Docs\All users\Start Menu\Programs\Startup\

on your windows source folder on your harddrive ok which is what you of course burn as your windows install image.

I think %allusersprofile%\start menu\programs\start up\shutdown.bat" is correct as i wrote previously

but here's a heads up : some variables dont allow the " \ " directly after it, (slash symbol) %examplevariable%\test\example.exe and instead use it without so it becomes %examplevariable%test\example.exe (note the second \ is correct anyway(of course))

Please let me know what works for you, and copy&paste it back here, so others can also benefit.

Thanks.

Ok buddy thanks a lot for this so am i right in thinking that on my XP .iso image (once i make it) i should create the following folder structure;

$OEM\$DOCS\All users\Start Menu\Programs\Startup\ then put shutdown.bat here (after creating seperate folders for each bit eg Start Menu).

Thanks again for this m8 very much appreciated

Stoner81

Edited by Stoner81
Link to comment
Share on other sites

If you are getting timing issues with the DriverPacks then you should use the custom finisher option and place the finisher command:

rem support Bashrat the Sneaky's Driver Packs
%SystemDrive%\DPsFnshr.exe

above the "Start ShutDown ..." line in your batch file.

The following is a good idea for the start of the batch file (2 minute delay, n-1):

rem startup delay to allow disk thrashing to subside before proceeding
Ping -n 121 127.0.0.1>nul

Edited by Kurt_Aust
Link to comment
Share on other sites

If you are getting timing issues with the DriverPacks then you should use the custom finisher option and place the finisher command:

rem support Bashrat the Sneaky's Driver Packs
%SystemDrive%\DPsFnshr.exe

above the "Start ShutDown ..." line in your batch file.

The following is a good idea for the start of the batch file (2 minute delay, n-1):

rem startup delay to allow disk thrashing to subside before proceeding
Ping -n 121 127.0.0.1>nul

You see I have the WPI (Windows Post Installer) running which install NOD32 v2.7 (among other things) THEN the driverpacks finisher runs. I have used nLite to put the command for the finisher to begin in the unattended section in nLite. So i need it to reboot ONCE the desktop loads and only then since NOD32 needs it before it will start running.

Thank you for your help :)

Stoner81

Link to comment
Share on other sites

You don't need to bother with the batch file. Just have it run

shutdown.exe -s -t 0

when everything is done. That's all there is to it.

When to run this and how? I need it to run once the desktop has loaded so as the WPI and the driverpacks finisher can both run then load the desktop then a reboot?

Thanks for the help

Stoner81

Link to comment
Share on other sites

Ah - I see the issue, Windows has to load first. Well, since shutdown.exe can be made to wait before shutting down, you could just run it from WPI (i've never used WPI - is this possible?) or else just using the RunOnce registry key, and instead of having it shut down immediately, have it wait however long you think it should. If you have it be the last thing that runs, then you might only need it to wait about 30 seconds. To make it wait, just do shutdown.exe -r -t xxx, where xxx is how many seconds to wait.

Link to comment
Share on other sites

Ah - I see the issue, Windows has to load first. Well, since shutdown.exe can be made to wait before shutting down, you could just run it from WPI (i've never used WPI - is this possible?) or else just using the RunOnce registry key, and instead of having it shut down immediately, have it wait however long you think it should. If you have it be the last thing that runs, then you might only need it to wait about 30 seconds. To make it wait, just do shutdown.exe -r -t xxx, where xxx is how many seconds to wait.

That may be possible m8 though im not sure, the finisher can take a while to sort itself out depending on system specs (ram. cpu etc) so getting the timing right would be difficult as it is i just do a manual reboot which sorts it out but would rather have it do it automatically :D

Thanks for your help

Link to comment
Share on other sites

The thinking about (ab)using the 'ping' command for pausing purposses, is that 'ping' allready is available on all systems, and no third-party tools need to be added to the install-source...

It will work no matter if there's network support available or not, as it dosen't matter if the pinging requests are answered or not...

It's a sorta hackish solution, but nonetheless then it works great and avoids the need for extra third-party tools, so i always use it myself...

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