Jump to content

Recommended Posts

Posted

Hi there, I am having a problem with my Cleanup.cmd file. I have this file setup on a cd so that it is not installed onto the hard drive during runonceex.cmd The registry part of this file works but the del command isn't deleting the c:\install folder I have posted my cleanup.cmd file here, the if statements are so that it can be run from my cd

cmdow @ /HID

@echo off

IF EXIST D:\CD.txt set CDROM=D:

IF EXIST E:\CD.txt set CDROM=E:

IF EXIST F:\CD.txt set CDROM=F:

IF EXIST G:\CD.txt set CDROM=G:

IF EXIST H:\CD.txt set CDROM=H:

IF EXIST I:\CD.txt set CDROM=I:

IF EXIST J:\CD.txt set CDROM=J:

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

net user aspnet /delete

DEL "%systemdrive%\Install"

Start %CDROM%\$OEM$\DeleteRegistryFiles.reg

NOTE: I figured out the problem, i just remembered the del command cannot delete folders that have files in them


Posted
why do you have this statement in your cleanup.cmd?

IF EXIST D:\CD.txt set CDROM=D:

IF EXIST E:\CD.txt set CDROM=E:

IF EXIST F:\CD.txt set CDROM=F:

IF EXIST G:\CD.txt set CDROM=G:

IF EXIST H:\CD.txt set CDROM=H:

IF EXIST I:\CD.txt set CDROM=I:

IF EXIST J:\CD.txt set CDROM=J:

Because he has %CDROM%\$OEM$\DeleteRegistryFiles.reg in his cleanup.cmd file (notice the %CDROM%)

Bloodstalker, the correct way of executing the reg file is regedit /S %CDROM%\$OEM$\DeleteRegistryFiles.reg otherwise you'll get a prompt asking if you want to import the entries.

DEL doesn't work on folders, use RD /S /Q %systemdrive%\install\ and this should be the very last line (even after your registry command)

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