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.

Install directory is not deleted by cleanup.cmd

Featured Replies

Here is a copy of my cleanup.cmd

cmdow @ /HID

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

net user aspnet /delete

RD /S /Q "%AllUsersProfile%\Start Menu\Programs\Java Web Start"

DEL "%UserProfile%\Start Menu\Programs\Windows Media Player.lnk"

DEL "%AllUsersProfile%\Start Menu\Programs\Windows Movie Maker.lnk"

DEL "%AllUsersProfile%\Desktop\Java Web Start.lnk"

DEL "%AllUsersProfile%\Start Menu\Programs\LaunchRA.lnk"

DEL "%systemdrive%\Install\"

RD /S /Q %systemdrive%\Install\

RD /S /Q %systemdrive%\drivers\

EXIT

Everything else seems to be working as advertised. But after all is said and done "C:\Install" is still there. Any ideals as to what I'm doing wrong?

Thanks

If you do have Admin rights which was one of my problem's but no longer. Move this line down to right above EXIT.

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

EXIT

I also use this format since its correct syntax. rd [Drive:]Path [/q]

Work's for me.

RD %systemdrive%\drivers\ /S /Q

One of these ought to work. Remember to put the Drivers directory above the Install directory or the Drivers directory won't get deleted.

RD /S /Q "%systemdrive%\Drivers"
RD /S /Q "%systemdrive%\Install"
RMDIR /S /Q %systemdrive%\Drivers\
RMDIR /S /Q %systemdrive%\Install\

Hi!

this also can be a timing issue, i had this when testing on a VMWare Enviourement, increasing the reboot time form 60 to 90 seconds solved this issue for me once and for all, so might also be worth a try!

Greetz

KMan

I've always used this code and it's always worked for me. I have the code run last, and anything that takes a long time to install such as nero i put at the top of the list.

HKLM,"%RunOnceEx%\ZZcleanup",2,,"%11%\cmd.exe /c rd /S /Q %10%\Apps"

-gosh

  • Author

maxXPsoft,

If you do have Admin rights which was one of my problem's but no longer. Move this line down to right above EXIT.

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

EXIT

When I tried this, it just hung there. Never rebooted

KMan,

I increased time to 2 mins and no help

HKLM,"%RunOnceEx%\ZZcleanup",2,,"%11%\cmd.exe /c rd /S /Q %10%\Apps"

Sorry Gosh,

I'm completely lost on how to apply this code. And what is ZZcleanup?

Please pardon my ignorance,

Thanks

When I tried this, it just hung there. Never rebooted
That narrows it down. Ok then if it hangs something else is wrong above that.

Heres mine

cmdow @ /HID

net user aspnet /delete

RD "%systemdrive%\Documents and Settings\All Users\Start Menu\Programs\PrintMe Internet Printing" /S /Q

RD "%systemdrive%\Documents and Settings\All Users\Start Menu\Programs\Java Web Start" /S /Q

DEL "%AllUsersProfile%\Desktop\Adobe Reader 6.0.lnk"

DEL "%AllUsersProfile%\Desktop\Java Web Start.lnk"

REM Cleanup Winzip if you have it. Remove if you don't

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"

REM Unhide protected Operating System Files

REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /V ShowSuperHidden /t REG_DWORD /D "1" /f

RD %systemdrive%\drivers\ /S /Q

RD %systemdrive%\install\ /S /Q

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

EXIT

And it work's, like I said I had problem's with it hanging cause my user wasn't getting Admin and I corrected that.

Just noticed also that yours has this

DEL "%systemdrive%\Install\"

RD /S /Q %systemdrive%\Install\

Remove the DEL "%systemdrive%\Install\" cause you getting that with next line with the RD which removes entire dir and thats probably where its hanging.

  • Author

:) maxXPsoft,

Thanks to you I have made some progress. This is what I have so far.

cmdow @ /HID

net user aspnet /delete

RD /S /Q "%AllUsersProfile%\Start Menu\Programs\Java Web Start"

DEL "%UserProfile%\Start Menu\Programs\Windows Media Player.lnk"

DEL "%AllUsersProfile%\Start Menu\Programs\Windows Movie Maker.lnk"

DEL "%AllUsersProfile%\Desktop\Java Web Start.lnk"

DEL "%AllUsersProfile%\Start Menu\Programs\LaunchRA.lnk"

RD /S /Q %systemdrive%\Drivers\

RD /S /Q %systemdrive%\Install\

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

EXIT

This would delete everything in C:\Install but not the directory itself and shut.exe would not run.

I then put shutdown.exe in the third line and it executes just fine and deletes everything in C:\Install.

I know there is more than one way to skin a cat.

Thanks for your help

Because you have RD /S /Q %systemdrive%\Install\ before the shutdown command, it deletes the install directory, thus killing the batch file thats in there. Its more wise to have the RD command last, and place shutdown somewhere above it.

Disoriented One

Then it was that

DEL "%systemdrive%\Install\"

RD /S /Q %systemdrive%\Install\

Aaron

What I posted works for me cause I'm thinking when you run the batch it's loaded into memory or in process. My Install get's deleted but is it because of processor, memory or what? Maybe fast processor is running next line . I don't know.

With the shutdown.exe -r -f -t 60 you have 60 seconds to carry out everything so that's plenty of time so moving it above certainly wouldn't hurt.

Good ? or no.

I may move mine above but i'm gonna test this a little, maybe write a bogus script that takes time then delete it and see what give's.

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.