Solved

Delete $NTUninstall files using a DOS command prompt.

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AD Replications issues 12 113
What is this Task? 4 129
How to restore security permissions on a file server 4 65
SBS 2003 RWW Login 3 42
Numerous times I have been asked this questions that what is it that makes my machine log on so slow, there have been cases where computers took 23 minute exactly after taking password and getting to the desktop. Interesting thing was the fact th…
Learn about cloud computing and its benefits for small business owners.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

790 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