Jump to content

Recommended Posts

Posted

During an unattended setup, i want to delete folders from the Programs menu. Not just the shortcuts but the whole folder to prevent unwanted bloat of folders I do not need such as Winzip, 7-zip and any others. This includes from all the profiles. What would i put in my cleanup.cmd to do this for each user profile?


Posted

Those folders can be found in "%UserProfile%\Start Menu\Programs" or in "%AllUsersProfile%\Start Menu\Programs". From a batch file like cleanup.cmd, just delete them (rmdir or rd) with the switches /S and /Q to delete each unwanted folder and any sub-folders it may contain, and do so without prompting for confirmation.

If you're not sure which profile a folder is in, you could delete it from both but you'll be unnecessarily deleting a number of folders that don't exist:

RD /S /Q "%UserProfile%\Start Menu\Programs\folder_to_delete"
RD /S /Q "%AllUsersProfile%\Start Menu\Programs\folder_to_delete"
RD /S /Q "%UserProfile%\Start Menu\Programs\next_folder_to_delete"
RD /S /Q "%AllUsersProfile%\Start Menu\Programs\next_folder_to_delete"
RD /S /Q "%UserProfile%\Start Menu\Programs\another_folder_to_delete"
RD /S /Q "%AllUsersProfile%\Start Menu\Programs\another_folder_to_delete"

%UserProfile% is equivalent to C:\Documents and Settings\(user name)

%AllUsersProfile% is the same as C:\Documents and Settings\All Users

You can also do this to create (mkdir or md) new folders if you want to consolidate things. I create a Media Players folder on my Programs menu then put shortcuts to all of my media players there. I also make a Ripping Tools folder for things like DVD Decrypter, DVD Shrink, DVD Flick, etc.

Ray

Posted

BTW, deleting those folders will only delete the shortcuts they contain. The programs will still be installed on your system.

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