Jump to content

I have a dumb question.


Recommended Posts

:blushing:

I may already know the answer to this, but here goes anyways. My cleanup.cmd never finishes everything. It seems like when it gets done deleting %systemdrive% \install, everything stops. Here's the dumb part...... could it be because that is where my cleanup.cmd is.... in the C:\install folder....so when that folder is deleted, so is my cleanup.cmd.

Link to comment
Share on other sites


The end of your "install" batch file should look like this...

*INSTALLING STUFF ABOVE THIS*


ECHO.
ECHO Restarting the PC in 1 minute...
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!"

ECHO.
ECHO Deleting Temp Installation Files...

RD /S /Q %systemdrive%\Drivers
RD /S /Q %systemdrive%\install

EXIT

If it looks similar, i don't see why it would hang on deleting your cleanup.cmd... btw.. your not having your "cleanup.cmd" delete the C:\Install folder are you?

If you've made a Cleanup.cmd file to automate the process of deleteing shorcuts and un needed folders (not the install folder) then i would run it like this...

Install.cmd

*INSTALLING STUFF ABOVE THIS*

ECHO.
ECHO Deleting Unnessesary Files and Folders...
start /wait cleanup.cmd

ECHO.
ECHO Restarting the PC in 1 minute...
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!"

ECHO.
ECHO Deleting Temp Installation Files...

RD /S /Q %systemdrive%\Drivers
RD /S /Q %systemdrive%\install

EXIT

Then in Cleanup.cmd...

@Echo off
cls
ECHO
ECHO Deleting Unnessesary Shortcuts and Folders... Please Wait...

*have all your delete settings here* (not to delete the install folder though)

Exit

Now what will happen, is when it hits the start /wait cleanup.cmd line in your install.cmd file it is going to start up the cleanup.cmd *that deletes files and folders* then the cleanup.cmd will exit when its finished. and continue on the install.cmd file. and will eventually hit the /RD /S /Q %systemdrive%\install folder which will clean up that mess. :P

Edited by Bi0haZarD
Link to comment
Share on other sites

:blushing:

I may already know the answer to this, but here goes anyways.  My cleanup.cmd never finishes everything.  It seems like when it gets done deleting %systemdrive% \install, everything stops.  Here's the dumb part...... could it be because that is where my cleanup.cmd is.... in the C:\install folder....so when that folder is deleted, so is my cleanup.cmd.

of course thats the reason.. u cant run something thats deleted lol

- Steve

Link to comment
Share on other sites

Add This to the end Of your cmd It produces A Inputbox Than you fill

it in with,what folder you want removed.Than it removes the folder than it

cleans up after it self.

I am not a coder I have Only Tried This On my Machine And It Seems To Work

cls
mode con: Cols=45 Lines=3
color a9
> %SystemDrive%\DelThis.vbs echo Dim FSO, Folder, CF
>> %SystemDrive%\DelThis.vbs echo set CF = (CreateObject("Scripting.FileSystemObject"))
>> %SystemDrive%\DelThis.vbs echo Set FS = CF
>> %SystemDrive%\DelThis.vbs echo CF=Inputbox("Type In The Folder You Want Deleted","Deleting the Folder: ","")
>> %SystemDrive%\DelThis.vbs echo MsgBox CF^&"",vbokonly+64,"Deleting"
>> %SystemDrive%\DelThis.vbs echo Wscript.sleep 500
>> %SystemDrive%\DelThis.vbs echo folder=""^&Cf
>> %SystemDrive%\DelThis.vbs echo fs.DeleteFolder "" ^&Cf
>> %SystemDrive%\DelThis.vbs echo Delete=""^&Cf

echo echo off > %SystemDrive%\CleanUp.cmd
echo cls >> %SystemDrive%\CleanUp.cmd
echo mode con: Cols=55 Lines=5 >> %SystemDrive%\CleanUp.cmd
echo color B2 >> %SystemDrive%\CleanUp.cmd
echo start /w %SystemDrive%\DelThis.vbs >> %SystemDrive%\CleanUp.cmd
echo del %SystemDrive%\DelThis.vbs >> %SystemDrive%\CleanUp.cmd
echo del %SystemDrive%\CleanUp.cmd >> %SystemDrive%\CleanUp.cmd
echo ping -n 1 127.0.0.1^>nul >> %SystemDrive%\CleanUp.cmd

call %SystemDrive%\CleanUp.cmd

Here One That Makes And Deletes Folders And Cleans Up After It Self

I Have Added The Option Of Keeping The folder That was Made, And It will

Make A Folder On Any Drive.

Edited by gunsmokingman
Link to comment
Share on other sites

The simple answer is 'YES' that is the reason, no fancy programming will help

you need to put the cleanup.cmd in the $OEM$ folder directly and call it up from there.

How do you call it up now?

through RunOnceEx?

if so you need to call it up directly from the cd.

for example like this but not in the install directory, it wont delete itself and will stop.

%CDROM%\$OEM$\cleanup.cmd

Link to comment
Share on other sites

Since you're new here, you should really be versed in the rules before posting. One of the rules is:

12. Very often we see meaningless subjects in topic title. They give no clue of what the posts are all about. For example:

- Oh no!

- Help

- I'm mad

- Please help

- Question

- I need your help

- Hmmmm ....

This should be avoided. Users should enter something more specific in topic title so that it is easier for others to help.

A few good examples:

- Strange problem with DirectX9b redist

- RunOnceEx install problem (double installation)

- Change Internet Explorer's Icon back to default

http://www.msfn.org/board/index.php?showtopic=18408

Please do we who post here frequently a favor by reading those and keeping mind of them in the future. Thanks :)

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