Retro Posted August 16, 2004 Share Posted August 16, 2004 i have created a Unattended Windows XP Pro installation.i have used the $oem$ structure to install programs like Winrar and Adobe Reader.but when the installation is complete, the directories in which the executables lie, isn't removed.i have tried making a batch script that removes the folders and reboot the PC.it looks like this:ECHO.ECHO Removing Temp install filesrmdir /s/q %systemdrive%\installrmdir /s/q %systemdrive%\DriversECHO.ECHO Restarting the PC in 1 minute...shutdown.exe -r -f -t 60 -c "Windows XP will now restart in 1 minute"EXITthis script is run from winnt.sif [GuiRunOnce] sectionbut it only removes the install directory and does nothing more.but if i take the script and run it after the installation is complete it works perfectly.can someone give some hints/help? Link to comment Share on other sites More sharing options...
mccorm79 Posted August 16, 2004 Share Posted August 16, 2004 I had a simpilar problem. Try moving the shutdown.exe command to the top of the file. Maybe try to add a sleep statment at the end like. ECHO.shutdown.exe -r -f -t 60 -c "Windows XP will now restart in 1 minute"ECHO Removing Temp install filesrmdir /s/q %systemdrive%\installrmdir /s/q %systemdrive%\DriversECHO.ECHO Restarting the PC in 1 minute...sleep -t 300EXITIt fixed my cleanup script. Not sure why it actually works, must be something with loading windows before the dir are deleted. Link to comment Share on other sites More sharing options...
jrzycrim Posted August 16, 2004 Share Posted August 16, 2004 If the batch file you are using to cleanup is in the install directory, you will need to delete that last, otherwise your batch is being deleted before it finishes.The last lines of your batch should look something like this:shutdown.exe -r -f -t 60 -c "Windows XP will now restart in 1 minute"ECHO Removing Temp install filesrmdir /s /q %systemdrive%\Drivers\rmdir /s /q %systemdrive%\Install\ Link to comment Share on other sites More sharing options...
Astalavista Posted August 16, 2004 Share Posted August 16, 2004 yup i made that mistake before aswell on my first go with my unattended xp cleanup.cmd.here is my cmd so you have an example to followcmdow @ /HIDshutdown.exe -r -f -t 20 -c "Windows XP will now restart in 20 secs..."del "%allusersprofile%\start menu\WinZip.lnk"del "%allusersprofile%\desktop\WinZip.lnk"del "%allusersprofile%\start menu\Programs\WinZip\Uninstall WinZip.lnk"del "%allusersprofile%\start menu\Programs\WinZip\Help Manual.lnk"del "%allusersprofile%\start menu\Programs\WinZip\ReadMe.txt.lnk"del "%allusersprofile%\start menu\Programs\WinZip\What's New.lnk"del "%allusersprofile%\desktop\Adobe Reader 6.0.lnk"del "%allusersprofile%\desktop\Nero StartSmart.lnk"RD /S /Q %systemdrive%\drivers\RD /S /Q %systemdrive%\install\RD /S /Q %systemdrive%\install\Cache\attrib -R "%programfiles%\winzip\*.*" /S /DREG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /V ShowSuperHidden /t REG_DWORD /D "1" /freg add HKCU\Software\Microsoft\Windows\CurrentVersion\Run /v ChikkaIM /t REG_SZ /freg add HKCU\Software\GameHouse\TextTwist /v FullScreen /t REG_DWORD /d 0 /fEXITi hope this can me some help to u Link to comment Share on other sites More sharing options...
Retro Posted August 17, 2004 Author Share Posted August 17, 2004 Thank you very much for the answersi used jrzycrim example code, cause my script is in the install directory...i works perfectly now 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