Jump to content

shutdown.exe question,


Recommended Posts

Ok, in my cleanup.cmd file i have the following

ECHO.
ECHO Cleaning up temp files...
RD /S /Q %systemdrive%\install

ECHO.
ECHO Restarting The PC In 1 Minute
start /wait shutdown.exe -r -f -t 60 -c "Windows XP will now restart in 1 minute, this will give enough time for the shortcuts to update and for the shell to fully load before its ready to restart!"

EXIT

This seems to work ok, but the EXIT part..

If i leave the EXIT at the end, shutdown runs, then the dos window closes, and shutdown gets aborted some how.

If i remove the EXIT command

ECHO.
ECHO Cleaning up temp files...
RD /S /Q %systemdrive%\install

ECHO.
ECHO Restarting The PC In 1 Minute
start /wait shutdown.exe -r -f -t 60 -c "Windows XP will now restart in 1 minute, this will give enough time for the shortcuts to update and for the shell to fully load before its ready to restart!"

Shutdown starts, but the dos window behind it stays and exporer doesnt seem to load. Is this suposed to happen? Will this be a problem for all the programs and hotfixes that installed?

When the system restars after, everything "seems" ok. I guess i am just expecting to run shutdown, and during those 60 seconds explorer will load...then shutdown.

Hopefully i'm making sense.. :)

I think its the "this will give enough time for the shortcuts to update and for the shell to fully load before its ready to restart! Thats throwing me off perhaps.

Link to comment
Share on other sites


i suppose not. i think all pending processes will wait (when you add the wait parameter) for the app to end before it continues loading those pending processes/apps (explorer included).

Link to comment
Share on other sites

It's sometimes better to let it fully load, that's what the wait period is for.

By having start /wait when you called SHUTDOWN.EXE, it prevented the desltop from loading. Removign it will close teh batch, but SHUTDOWN.EXE should keep running so that the desktop loads fully.

Link to comment
Share on other sites

It's sometimes better to let it fully load, that's what the wait period is for.

By having start /wait when you called SHUTDOWN.EXE, it prevented the desltop from loading. Removign it will close teh batch, but SHUTDOWN.EXE should keep running so that the desktop loads fully.

ok trying that now in vmware

all i have in there now is

ECHO.
ECHO Cleaning up temp files...
RD /S /Q %systemdrive%\install

ECHO.
ECHO Restarting The PC In 1 Minute
shutdown.exe -r -f -t 70 -c "Windows XP will now restart in 1 minute, this will give enough time for the shortcuts to update and for the shell to fully load before its ready to restart!"

EXIT

Link to comment
Share on other sites

hmmm same thing happened

Shutdown started, then the dos window colsed...then shutdown aborted.

Could this have something to do with me using vmare?

Or is there something wrong with my file? I removed the cleanup.cmd file and just added it into my main .cmd file run from guirunonce

CLS
@echo off
MODE CON COLS=80 LINES=40
COLOR 0F
TITLE Windows XP SP1 - Unattended Installation

ECHO.
ECHO Over the next few minutes you will see automated installations
ECHO of various sofware applications and registry
ECHO tweaks being implemented. The computer will restart automatically
ECHO once the whole process has finished!

ECHO.
ECHO Importing Reg Tweaks
REGEDIT /S %systemdrive%\apps\regtweaks.reg

ECHO.
ECHO Installing DirectX 9.0b
ECHO Please wait...
start /wait %systemdrive%\install\Applications\DirectX9b\DX9NTopk.exe

ECHO.
ECHO Installing WinRAR 3.3 Plus
ECHO Please wait...
start /wait %systemdrive%\install\Applications\wrar330.exe /s

ECHO.
ECHO Installing Spybot SD v1.3
start /wait %systemdrive%\install\Applications\spybot\spybotsd13.exe /VERYSILENT /NOCANCEL /TASKBARHIDE /AUTOCLOSE

ECHO.
ECHO Installing Nero Burning ROM v6.3.1.6
ECHO Please wait...
start /wait %systemdrive%\install\Applications\nero\nero6316.exe /SN=xxxxxxxxxxxxxxxxxxxxxxxx /WRITE_SN /SILENT /NOREBOOT

ECHO.
ECHO Installing Alcohol 120
ECHO Please wait...
start /wait %systemdrive%\install\Applications\alcohol120\setup.exe /qn Reboot=Suppress

ECHO.
ECHO Reigistering alcohol 120....
REGEDIT /S %systemdrive%\Applications\alcohol120\asoft.reg

ECHO.
ECHO Verifying hotfix installation. Please run qfecheck after reboot to check for proper hotfix installation.
ECHO Please wait...
start /wait %systemdrive%\install\Applications\Q282784.exe -u -q -z

ECHO.
ECHO Installing codecs
start /wait %systemdrive%\install\codecs.cmd

ECHO.
ECHO Registering codec files...
REGEDIT /S %systemdrive%\install\codecs.reg

ECHO.
ECHO Cleaning up temp files...
RD /S /Q %systemdrive%\install

ECHO.
ECHO Restarting The PC In 1 Minute
shutdown.exe -r -f -t 70 -c "Windows XP will now restart in 1 minute, this will give enough time for the shortcuts to update and for the shell to fully load before its ready to restart!"

EXIT

Link to comment
Share on other sites

i know that sometimes progs are still installing and the shut down continues, i decided in mine since i waited sooooo long for the process to complete that i made the wait time 5 minutes to shut down, that gave it PLENTY of time to finish up adn load.

ECHO.

ECHO Restarting the PC in 5 minutes...

shutdown.exe -r -f -t 300 -c "Windows XP Professional Service Pack 2 will restart in 5 minutes, this will give enough time for Windows to update the shell and to fully load before it's ready to restart! Please remain patient, the whole process is almost over."

ECHO.

ECHO Deleting Temp Installation Files...

RD /S /Q %systemdrive%\install

EXIT

Link to comment
Share on other sites

ECHO.

ECHO Restarting the PC in 5 minutes...

shutdown.exe -r -f -t 300 -c "Windows XP Professional Service Pack 2 will restart in 5 minutes, this will give enough time for Windows to update the shell and to fully load before it's ready to restart! Please remain patient, the whole process is almost over."

ECHO.

ECHO Deleting Temp Installation Files...

RD /S /Q %systemdrive%\install

EXIT

Thanks i think vmware just takes longer to load explorer.

Link to comment
Share on other sites

5 mins 2 wait :| im using vmware, i have my shutdown command set for 30seconds, vmware takes about 15 seconds 2 fully load explorer, then another 15 it will shutdown

heres mine

shutdown.exe -r -r -t 30

Link to comment
Share on other sites

The problem is that you are cleaning up the files first....so the cleanup.cmd file gets deleted before making it to the next line....the shutdown one.

Sooooooo, either keep your cleanup.cmd file in a different location or issue the shutdown first.

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