Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Update > Command line to delete $NtUninstallKB...$

Reply
Thread Tools Display Modes

Command line to delete $NtUninstallKB...$

 
 
rodommoc@yahoo.com
Guest
Posts: n/a

 
      08-31-2005
Command line to delete $NtUninstallKB...$ I made a batch file to delete
temporary internet files, user's temp files, & Windows\temp files. I
want to add deleting the Windows Update uninstall directories to the
BAT file. I have tried DEL, RD, ERASE, I used CACLS to give everyone
full access, Attrib -R -A -S -H to unhide the directories. It will not
let me use wildcards to delete the directories. I tried $nt*$, $*$,
$NTUninstall*. It forces me to use the full directory name. I used
"RD /S /Q c:\Windows\$NtServicePackUninstall$" and it works but I have
PCs with Windows 2000 SP1-SP4, Windows XP SP1-SP2 it would take a lot
to keep this cleanup BAT file up to date with the new updates. Any
help would be much appreciated.

 
Reply With Quote
 
 
 
 
Torgeir Bakken \(MVP\)
Guest
Posts: n/a

 
      09-01-2005
wrote:

> Command line to delete $NtUninstallKB...$ I made a batch file to delete
> temporary internet files, user's temp files, & Windows\temp files. I
> want to add deleting the Windows Update uninstall directories to the
> BAT file. I have tried DEL, RD, ERASE, I used CACLS to give everyone
> full access, Attrib -R -A -S -H to unhide the directories. It will not
> let me use wildcards to delete the directories. I tried $nt*$, $*$,
> $NTUninstall*. It forces me to use the full directory name. I used
> "RD /S /Q c:\Windows\$NtServicePackUninstall$" and it works but I have
> PCs with Windows 2000 SP1-SP4, Windows XP SP1-SP2 it would take a lot
> to keep this cleanup BAT file up to date with the new updates. Any
> help would be much appreciated.
>

Hi,

You can use this in your batch file:

set unf=%SystemRoot%\$NtUninstall*
for /f "Tokens=*" %%i in ('dir /B /AD %unf%') do rd /s /q "%SystemRoot%\%%i"



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scr...r/default.mspx
 
Reply With Quote
 
rodommoc@yahoo.com
Guest
Posts: n/a

 
      09-01-2005
Thank you
Here is the whole script:

REM Deletes Temporary Internet Files

cd /d c:\Documents and Settings
for /d %%X in (*) do rd /s /q "C:\Documents and Settings\%%X\Local
Settings\Temporary Internet Files"

REM Deletes All User's temp files

for /d %%X in (*) do rd /s /q "C:\Documents and Settings\%%X\Local
Settings\Temp"

REM Deletes Windows and WINNT Temp
rd /s /q %SystemRoot%\temp\*.*

REM Deletes Microsoft Update files

set unf=%SystemRoot%\$NtUninstall*
for /f "Tokens=*" %%i in ('dir /B /AD %unf%') do rd /s /q
"%SystemRoot%\%%i"

set unf=%SystemRoot%\$MSI31Uninstall*
for /f "Tokens=*" %%i in ('dir /B /AD %unf%') do rd /s /q
"%SystemRoot%\%%i"

set unf=%SystemRoot%\$NtServicePack*
for /f "Tokens=*" %%i in ('dir /B /AD %unf%') do rd /s /q
"%SystemRoot%\%%i"

 
Reply With Quote
 
Guest
Posts: n/a

 
      09-04-2005
This looks like a nice easy way to dump the old stuff. But where do I
put it? How do I active it? (I have never created or manually used a
batch file).

Please help me!

<*((((><{




In the last exciting episode on 1 Sep 2005 16:30:41 -0700,
wrote:

>Thank you
>Here is the whole script:
>
>REM Deletes Temporary Internet Files
>
>cd /d c:\Documents and Settings
>for /d %%X in (*) do rd /s /q "C:\Documents and Settings\%%X\Local
>Settings\Temporary Internet Files"
>
>REM Deletes All User's temp files
>
>for /d %%X in (*) do rd /s /q "C:\Documents and Settings\%%X\Local
>Settings\Temp"
>
>REM Deletes Windows and WINNT Temp
>rd /s /q %SystemRoot%\temp\*.*
>
>REM Deletes Microsoft Update files
>
>set unf=%SystemRoot%\$NtUninstall*
>for /f "Tokens=*" %%i in ('dir /B /AD %unf%') do rd /s /q
>"%SystemRoot%\%%i"
>
>set unf=%SystemRoot%\$MSI31Uninstall*
>for /f "Tokens=*" %%i in ('dir /B /AD %unf%') do rd /s /q
>"%SystemRoot%\%%i"
>
>set unf=%SystemRoot%\$NtServicePack*
>for /f "Tokens=*" %%i in ('dir /B /AD %unf%') do rd /s /q
>"%SystemRoot%\%%i"


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
command line user Windows Vista General Discussion 0 02-16-2009 09:43 PM
What is the command line command for unzipping files? Jim H Windows Vista General Discussion 3 12-04-2008 03:22 AM
Command Line Ren (Rename) command broken? SixSigmaGuy Windows Vista General Discussion 5 05-20-2008 10:52 AM
XP command line Qfreed Windows Vista Networking 2 08-25-2007 02:31 PM
How do you use command line in shortcuts now ? steve h. Windows Vista General Discussion 8 06-29-2006 05:25 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59