Jump to content

cleanup.cmd not deleting dotnet folder


Recommended Posts

at the moment my cleanup.cmd file works fine, deleting all specified files except a 'dotnet' folder. I assume this is because the dotnet2.0 is installed after cleanup.cmd has run? dotnet2.0 is intergrated using nLite (here is the addon for reference)

addon install notes: "Installs just before the Desktop appears, it takes a while, you must use the winnt.sif generated by nLite..."

therefore I assume this means it is installed after cleanup.cmd has been executed..

so how do I specify my cleanup.cmd to run after the installation of this application?

attached are my runonceex.cmd and cleanup.cmd files

cleanup.cmd

runonceex.cmd

Edited by piXelatedEmpire
Link to comment
Share on other sites


My cleanup.cmd didn't even start to delete the install-folder files, but i guess when its last one in the script i have to hit enter after it, so it won't wait for user to hit enter when only copying the script to command prompt :)

Link to comment
Share on other sites

[GuiRunOnce] in winnt.sif?

ok, so I ran my cleanup.cmd from [GuiRunOnce] but the dotnet folder is still present on c:\

here is my cleanup.cmd

cmdow @ /HID
psshutdown.exe -r -f -t 30 -c "Cleaning installation; XP will restart in 30 seconds..."

net user aspnet /delete

FOR %%? IN (log tmp) DO (DEL/A/S/F/Q "%SYSTEMROOT%\*.%%?")

DEL "%AllUsersProfile%\Start Menu\Microsoft Update.lnk"
DEL "%AllUsersProfile%\Start Menu\Programs\Internet Explorer.lnk"

DEL "%UserProfile%\Start Menu\Programs\Internet Explorer.lnk

DEL "%UserProfile%\Local Settings\Temp\*.*"

RD /S /Q %UserProfile%\My Documents\

RD /S /Q %AllUsersProfile%\Documents\

RD /S /Q %systemdrive%\Install\
RD /S /Q %systemdrive%\dot20\

EXIT

I'm thinking would it be best to run say cleanup1.cmd via runonceex.cmd and then cleanup2.cmd from [GuiRunOnce] ?

If I was to execute a second cleanup.cmd from [GuiRunOnce] would I require this first line?

cmdow @ /HID
psshutdown.exe -r -f -t 30 -c "Cleaning installation; XP will restart in 30 seconds..."

Edited by piXelatedEmpire
Link to comment
Share on other sites

Isn't it just shutdown.exe, not psshutdown.exe?

And you could put the psshutdown.exe line at the very beginning of 1st cleanup.cmd, after cmdow @ /hid

As mazin said, psshutdown.exe is a similar utility to shutdown.exe.

And that line of code is at the very beginning of the 1st cleanup.cmd. My question is would I require this line in my 2nd cleanup.cmd that is executed from [GuiRunOnce] ?

Link to comment
Share on other sites

RunOnceEx and GuiRunOnce execute at exactly the same time, so you might want to set a longer timeout for how long it takes before reboot.

No, if the psshutdown line is in one, it doesn't need to be in the other. But it mightt be an idea to set a longer timeout if you are going to use both cleanup.cmd's at the same time.

Link to comment
Share on other sites

I install tons and tons of programs, it goes all the way down the screen. I install the others that won't fit in GuiRunOnce.

And you only need to use one anyway.

I think I have the solution. As you install a cleanup.cmd via guirunonce and .net framework via ROE, the GRO cleanup.cmd can't delete the dot20 folder as it's currently in use.

Try not using GRO and put it all in Runonceex.

Link to comment
Share on other sites

RunOnceEx and GuiRunOnce execute at exactly the same time

Oh really. :huh: Is the ref.chm incorrect with the key where GRO launches from then?

Commands called in the [GuiRunOnce] section process synchronously. Each application runs in the order listed in this section, and each command must finish before you run the next command.

Each line specifies a command that the [GuiRunOnce] registry entry executes, HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Runonce

HKLM\...\RunOnceEx (ROE) waits for executions to finish, then HKLM\...\RunOnce starts and waits for executions, then HKLM\...\Run starts it's executions, then the desktop loads with the start of HKCU\...\RunOnce (GRO) executions along with the startup folders.

Link to comment
Share on other sites

The unattended guide says that they execute at the same time... I don't personally pay attention when it's installing (unattended isn't it) so I don't know.

So we're back to not deleting dot20. Anyone w/ideas?

Edited by T D
Link to comment
Share on other sites

@ piXelatedEmpire

I'm sorry for this.

But I can't understand why you're insisting to

delete the folder by your cleanup.cmd!

You can just use HKLM\..\RUN to delete the folder.

Both the following methods should work. You can use one of them to do the job.

It does not matter whether dotnet2 has or hasn't been installed yet.

I assume the folder you want to delete is: %SystemDrive%\dot20

I, also, assume that it is deletable. (not protected)

EITHER:

Add these lines to any batch file you use at T-13 or T-12.

SET KEYRUN=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

REG ADD %KEYRUN% /v DOT2 /d "cmd /C RD /S /Q %SystemDrive%\dot20 | REG DELETE %KEYRUN% /v DOT2 /f"

OR:

Import this reg file at T-13 or T-12.

Or just delete "Windows Registry Editor Version 5.00"

and add the rest to any reg file you may have got.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]

"DOT2"="cmd /C RD /S /Q %SystemDrive%\\dot20 | REG DELETE HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run /v DOT2 /f"

HTH

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