Solved

Delete $NTUninstall files using a DOS command prompt.

Posted on 2010-09-09
4
1,719 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

I have never ceased to be amazed how many problems you can encounter on a fresh install of a Windows operating system.  This is certainly case in point& Unable to complete ANY MSI installation.  This means Windows Updates are failing and I can't …
I guess it is not common knowledge to most Wintel engineers/administrators: If you have an SNMP-based monitoring system in your environment (and it's common to have SNMP or Syslog) it's reasonably easy to enable monitoring of the Windows Event logs,…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now