Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

cleanup.cmd not deleting dotnet folder

Featured Replies

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


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

Course you can use RunOnceEx and GuiRunOnce!

  • Author
[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

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

psshutdown.exe is a similar utility as shutdown.exe!

  • Author
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] ?

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.

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.

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.

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

@ 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

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.