Originally posted by jun19841 at 2006-5-25 00:57:
attrib +h /s %drive%\*.exe
将该批处理 放至 D盘中只对本盘的 .exe文件做隐藏
要是想将所有盘.exe做隐藏 , 环境变量又改怎么设置?
SET 也可以设置环境堮..
得用for语句对所有的磁盘进行列举,代码如下:
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
if exist %%a:\recycled\nul attrib +h /s %%a:\*.exe
if exist %%a:\recycler\nul attrib +h /s %%a:\*.exe
)
不敢实测,但是觉得
attrib +h /s %%a:\*.exe 似乎难以对所有的exe文件进行操作.
Last edited by namejm on 2006-5-25 at 13:46 ]
Originally posted by jun19841 at 2006-5-25 00:57:
attrib +h /s %drive%\*.exe
Put this batch file in drive D to hide only .exe files in this drive.
If you want to hide .exe files in all drives, how to set the environment variables?
SET can also set environment variables..
You need to use the for statement to list all drives. The code is as follows:
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
if exist %%a:\recycled\nul attrib +h /s %%a:\*.exe
if exist %%a:\recycler\nul attrib +h /s %%a:\*.exe
)
Dare not test it actually, but think that
attrib +h /s %%a:\*.exe seems difficult to operate on all .exe files.
Last edited by namejm on 2006-5-25 at 13:46 ]