owoods Posted January 16, 2005 Share Posted January 16, 2005 Hi,I am successfull automating the install of windows - however, during the software installation which runs from a batch file, I want to do a reboot. How can I reboot and then the batch file continue from where it stopped to reboot?TIAOLI Link to comment Share on other sites More sharing options...
sixpack Posted January 16, 2005 Share Posted January 16, 2005 http://www.msfn.org/board/index.php?showtopic=30110http://www.msfn.org/board/index.php?showtopic=30179&hl= Link to comment Share on other sites More sharing options...
owoods Posted January 16, 2005 Author Share Posted January 16, 2005 Yes, id already searched the forum before i posted! Im very confused and new to all this... Ive attached my batch file that is installing the software and inserted some lines near the bottom detailing what I want to do. Can you please give me some instuctions? This file runs on first logon.Many thanks in advance.Olisoftware.cmd Link to comment Share on other sites More sharing options...
sixpack Posted January 16, 2005 Share Posted January 16, 2005 wy you want to reboot after nero? Link to comment Share on other sites More sharing options...
Gagorian Posted January 17, 2005 Share Posted January 17, 2005 Indeed, it seems a bit strange.. As I see it you could just reboot after the last installation is complete. But if you really want to reboot in between and then continue from that point you need to make the last commands into separate cmd files and just use REG.exe to add the cmdfiles into RunOnceI personally like using poweroff.exe to reboot.I use the following commandline with it:poweroff.exe reboot -force -nocancel -warn -warntime 25 -msg "Windows 2000 will now restart in 25 seconds for the installation to be complete."You can get it from http://users.pandora.be/jbosman/poweroff/poweroff.htmPlace the poweroff.exe to the $OEM$\$$\system32 folder and then make your batch run that commandline. Link to comment Share on other sites More sharing options...
owoods Posted January 17, 2005 Author Share Posted January 17, 2005 Just cos it seems like a good point to do it! Link to comment Share on other sites More sharing options...
owoods Posted January 17, 2005 Author Share Posted January 17, 2005 Great, so what do I do with REG.EXE?? Link to comment Share on other sites More sharing options...
Gagorian Posted January 17, 2005 Share Posted January 17, 2005 Well, it's your call. I just think it serves no point to reboot twice in between.So, you should add this to your first command file.SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceREG ADD %KEY% /V 1 /D "%systemdrive%\path_to_file\software2.cmd" /fAnd then just add another like that to your next command file (two reboots, three files in total)SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceREG ADD %KEY% /V 1 /D "%systemdrive%\path_to_file\software3.cmd" /f Link to comment Share on other sites More sharing options...
prathapml Posted January 17, 2005 Share Posted January 17, 2005 That is to run your software2.cmd after a reboot.After the line above, you should have this (on WinXP):shutdown.exe -r -f -t 60 -c "Windows XP will now restart in a minute... This will give enough time for the shortcuts to update and for the shell to fully load before its ready to restart!"shutdown.exe is part of windowsXP itself so no extra files to be downloaded. Link to comment Share on other sites More sharing options...
Gagorian Posted January 17, 2005 Share Posted January 17, 2005 Yeah, the reason I prefer poweroff.exe however is that it's a bit more customizable and it doesn't look like an error message (like shutdown.exe does. It also reminds me too much of MS Blaster!). Link to comment Share on other sites More sharing options...
un4given1 Posted January 17, 2005 Share Posted January 17, 2005 I don't like linking to other forums, but here goes...http://forum.osnn.net/showthread.php?t=36648Post by me in November 2003. There is a script there that I used to do exactly what you are wanting to do. Let me know if this helps. Link to comment Share on other sites More sharing options...
Gagorian Posted January 17, 2005 Share Posted January 17, 2005 @un4given1Nice script, yet it might be a bit hard to understand if someone is still a beginner in unattended installs. It's just a lot easier to split the commandfile up into seprate pieces. Link to comment Share on other sites More sharing options...
un4given1 Posted January 17, 2005 Share Posted January 17, 2005 It really isn't as complicated as you might think. Just map out the GOTOs and you will find it's easy. Link to comment Share on other sites More sharing options...
Gagorian Posted January 17, 2005 Share Posted January 17, 2005 I know it isn't complicated, I looked it through. But I'm still saying that it's harder for someone understand if he has just started working on commandfiles. It can be made a lot simpler (but maybe not as "neat") with multiple files. It's up to the poster to decide which method to use Link to comment Share on other sites More sharing options...
Astalavista Posted January 17, 2005 Share Posted January 17, 2005 check the script out u dont need a lot of brains to figure out. it is very simple to understandbookmarked the link for future ref Link to comment Share on other sites More sharing options...
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