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