Board logo

标题: 怎么用P处理去删除$NtUninstallKB873339$ [打印本页]

作者: guigui     时间: 2008-6-29 20:51    标题: 怎么用P处理去删除$NtUninstallKB873339$

怎么用P处理去删除windows目录下的一大堆 $NtUninstallKB873339$  $NtUninstallKB886185$ 这些补丁更新的文件???
我有试过 $*$    可是没用

[ Last edited by guigui on 2008-6-29 at 09:04 PM ]
作者: dslz666     时间: 2008-6-30 03:26
cd /D %windir%
attrib -r -s -h c:$*$ /s /d
for /d %%d in (c:$*$) do rd "%%d" /s /q

这样试试
作者: guigui     时间: 2008-7-1 21:54
不行  闪一下就没了

难道没办法了么 !!!
作者: HAT     时间: 2008-7-1 22:15
在命令行解释器里面运行一下,把结果贴出来看看。
作者: moniuming     时间: 2008-7-1 22:18
把下面的代码粘贴到命令提示符里运行看看?
如果没有错误提示,则说明删除成功.
for /d %a in ("%systemroot%\$*$") do @rd /s /q "%a"

作者: guigui     时间: 2008-7-1 23:02
我按照楼上大哥的P处理做了  但什么错误信息都没报    文件也都没被删除  全在

我在CMD里直接复制运行的
作者: HAT     时间: 2008-7-1 23:10
这个呢?
for /f %a in ('dir /ad /b "%systemroot%\$*$"') do rd /s /q "%systemroot%\%a"

作者: terse     时间: 2008-7-2 01:17
dir /a-d /b + del 呢?
作者: guigui     时间: 2008-7-2 10:24
HAT大哥  好像成功了  但是为什么直接在CMD里运行就好的     命令复制到.BAT里运行就是一闪而过  文件也没删掉?   我试了好几遍都是这样
作者: sylovanas     时间: 2008-7-2 10:29


  Quote:
Originally posted by guigui at 2008-7-2 10:24 AM:
HAT大哥  好像成功了  但是为什么直接在CMD里运行就好的     命令复制到.BAT里运行就是一闪而过  文件也没删掉?   我试了好几遍都是这样

bat %a 要改成 %%a
作者: HAT     时间: 2008-7-2 10:31
尽快学会看帮助

  Quote:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Test>for /?
Runs a specified command for each file in a set of files.

FOR %variable IN (set) DO command [command-parameters]

  %variable  Specifies a single letter replaceable parameter.
  (set)      Specifies a set of one or more files.  Wildcards may be used.
  command    Specifies the command to carry out for each file.
  command-parameters
             Specifies parameters or switches for the specified command.

To use the FOR command in a batch program, specify %%variable instead
of %variable.
  Variable names are case sensitive, so %i is different
from %I.


作者: guigui     时间: 2008-7-2 10:32
我试试哦
作者: guigui     时间: 2008-7-4 10:18
我还是好笨哦   在.bat 里试来试去就是不成功  总是一闪而过
哎  看来我还要多学学了     还是要麻烦哪为大哥帮我写一个啊?
作者: HAT     时间: 2008-7-4 10:47

for /f %%a in ('dir /ad /b "%systemroot%\$*$"') do rd /s /q "%systemroot%\%%a"
把代码保存为C:\test.bat
开始,运行,cmd,C:\test.bat
把结果贴出来看看
作者: guigui     时间: 2008-7-4 11:46
成功了   哈哈
但是当时我就是这样写的 就是和HAT大哥一样的命令 但为什么一闪而过呢
后来我就又新建了一个test.bat  然后把命令重新在复制进去就又可以了  晕  这是什么情况啊
作者: tvzml     时间: 2008-7-9 00:54
cd /D %windir%
for /f %%i in ('dir /b/a $*$') do echo rd "%%i" /s /q