Jump to content

rebooting in runonce.exe causing error


Recommended Posts

after i put rebooting in my RunOnceEx.cmd, an error screen pops up for less than a second, but rebooting does commence. is there something wrong here with the shutdown.exe switches?? maybe the reboot time is too short? (if so, how many minimum seconds are recommended)

any feedback is appreciated! thanks

here's my RunOnceEx.cmd

cmdow @ /HID
@echo off
FOR %%i IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%i:\CD.txt SET CDROM=%%i:

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY% /V TITLE /D "Final Modifications" /f

REG ADD %KEY%\005 /VE /D "Installing Microsoft Office 2003" /f
REG ADD %KEY%\005 /V 1 /D "%CDROM%\Software\Office2003\Office2003.exe" /f

REG ADD %KEY%\010 /VE /D "Importing Registry Tweaks" /f
REG ADD %KEY%\010 /V 1 /D "REGEDIT /S %CDROM%\Software\regtweaks.reg" /f

REG ADD %KEY%\015 /VE /D "Reboot Computer" /f
REG ADD %KEY%\015 /V 1 /D "shutdown.exe -r -f -t 1" /f

EXIT

Edited by 1boredguy
Link to comment
Share on other sites


i'm betting the screen you're talking about, is perhaps the screen telling you the system is shutting down. You do only have a 1 second delay.

I recommend a 60+ delay, so that the desktop fully loads and doesn't cause potential problems later on.

Link to comment
Share on other sites

here is the error screen. how do i get rid of it?

i did change the delay to 60 seconds. but the error screen still comes up. notice that the 60 seconds is in the error screen. maybe if i set no delay??? i just want the system to restart after completion of RunOnceEx.cmd

cmdow @ /HID
@echo off
FOR %%i IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%i:\CD.txt SET CDROM=%%i:

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY% /V TITLE /D "Final Modifications" /f

REG ADD %KEY%\005 /VE /D "Installing Microsoft Office 2003" /f
REG ADD %KEY%\005 /V 1 /D "%CDROM%\Software\Office2003\Office2003.exe" /f

REG ADD %KEY%\010 /VE /D "Importing Registry Tweaks" /f
REG ADD %KEY%\010 /V 1 /D "REGEDIT /S %CDROM%\Software\regtweaks.reg" /f

REG ADD %KEY%\015 /VE /D "Finalise & Reboot Computer" /f
REG ADD %KEY%\015 /V 1 /D "shutdown.exe -r -f -t 60" /f

EXIT

post-29225-1120029520_thumb.jpg

Edited by 1boredguy
Link to comment
Share on other sites

I just tried it without a delay.

REG ADD %KEY%\015 /V 1 /D "shutdown.exe -r -f" /f

but it then gives a delay anyway of 30 seconds.

i just want the RunOnceEx.cmd to install the stuff, then restart... am i taking a wrong approach? is there a better way? :huh:

Link to comment
Share on other sites

That window is just a visable warning, that the system is shutting down. This is very normal. Logging into the desktop, the first time, is a important stage. I would recommend, as Alanoll has recommended, in using 60 seconds for shutdown, other wise your themes etc. will not be setup properly.

Link to comment
Share on other sites

If it looks too much like an error to you, try adding a comment to it (shows up in the Message section of that window). Just add a -c switch, and the comment you want to show.

REG ADD %KEY%\015 /VE /D "Finalise & Reboot Computer" /f
REG ADD %KEY%\015 /V 1 /D "shutdown.exe -r -f -t 60 -c \"Finalizing installation process.  Please wait while your system reboots.\"" /f

(On a side note, at first I thought you misspelled "Finalise," but Dictionary.com actually lists both "Finalize" and "Finalise." I think it's more common to see it with a z, however.)

Link to comment
Share on other sites

thanks for the great responses guy! and helping me understand this process. i have inserted a new comment, so it looks a little better. maybe later i'll look around for some program like xplode (a free one hopefully).

thanks! :thumbup

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