Solved

Delete $NTUninstall files using a DOS command prompt.

Posted on 2010-09-09
4
1,741 Views
Last Modified: 2012-05-10
I have developed a simple batch file generator using VisualStudio C#.NET that installs multiple Microsoft patch upgrades in a single .bat file.  I'd like to add code to the .bat file that wil delete the associated $NTUninstallKB999999 files as well.  When I view the directory where the $NTUninstall files are located using the CMD/DOS window, I do not see them, nor can I build a DOS statement that will delete them.  Any suggestions?  Is there a command string that I can write in C# that will tell Windows to delete these files?
0
Comment
Question by:rdbrunet
  • 2
4 Comments
 
LVL 95

Accepted Solution

by:
Lee W, MVP earned 175 total points
ID: 33637857
The folders are hidden by default.

ATTRIB $NTUninstall..... -R -S -H

should remove all attributes protecting them.

Then use the RD /S /Q $NTUninstall... command - but be careful.  if done at the wrong spot you could wipe out windows.
0
 
LVL 1

Assisted Solution

by:chadcku
chadcku earned 75 total points
ID: 33637878
A dos statement of "del c:\windows\$NtUninstallKB982214$ /q" Should work. If you wish to see the diretories, then "dir c:\windows\$Nt*.* /ah" should let you see them.
0
 
LVL 95

Assisted Solution

by:Lee W, MVP
Lee W, MVP earned 175 total points
ID: 33637991
The DEL command will not delete the directory or the subdirectories of the folders that have subfolders.

RD /S /Q should.

(It MAY be unnecessary to unhide the folders with ATTRIB. I'd try the RD command with the correct folder name first).
0
 

Author Closing Comment

by:rdbrunet
ID: 33638698
Great solution.  Thanks for the leg up.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question