Jump to content

Removing $oem$ folder after install is complete


Recommended Posts

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 files

rmdir /s/q %systemdrive%\install

rmdir /s/q %systemdrive%\Drivers

ECHO.

ECHO Restarting the PC in 1 minute...

shutdown.exe -r -f -t 60 -c "Windows XP will now restart in 1 minute"

EXIT

this script is run from winnt.sif [GuiRunOnce] section

but 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


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 files

rmdir /s/q %systemdrive%\install

rmdir /s/q %systemdrive%\Drivers

ECHO.

ECHO Restarting the PC in 1 minute...

sleep -t 300

EXIT

It 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

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 files
rmdir /s /q %systemdrive%\Drivers\
rmdir /s /q %systemdrive%\Install\

Link to comment
Share on other sites

:P 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 follow

cmdow @ /HID
shutdown.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 /D
REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /V ShowSuperHidden /t REG_DWORD /D "1" /f
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Run /v ChikkaIM /t REG_SZ /f
reg add HKCU\Software\GameHouse\TextTwist /v FullScreen /t REG_DWORD /d 0 /f

EXIT

i hope this can me some help to u

:)

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