MSFN Forum: Removing $oem$ folder after install is complete - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Removing $oem$ folder after install is complete Rate Topic: -----

#1 User is offline   Retro 

  • Group: Members
  • Posts: 9
  • Joined: 16-August 04

  Posted 16 August 2004 - 05:24 AM

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:

Quote

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? :)


#2 User is offline   mccorm79 

  • Newbie
  • Group: Members
  • Posts: 21
  • Joined: 26-May 04

Posted 16 August 2004 - 07:11 AM

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.

#3 User is offline   jrzycrim 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 769
  • Joined: 17-March 04

Posted 16 August 2004 - 09:52 AM

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\


#4 User is offline   Astalavista 

  • MSFN loyalist
  • PipPipPipPipPipPipPipPipPip
  • Group: Banned
  • Posts: 3,338
  • Joined: 02-December 03

Posted 16 August 2004 - 10:10 AM

: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
:)

#5 User is offline   Retro 

  • Group: Members
  • Posts: 9
  • Joined: 16-August 04

Posted 17 August 2004 - 01:49 AM

Thank you very much for the answers


i used jrzycrim example code, cause my script is in the install directory...

i works perfectly now :D :thumbup

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy