想要在vbs脚本中添加一段代码,以实现取消显示隐藏文件,并把指定目录下的文件夹(文件夹内的子文件夹和文件不隐藏)和文件隐藏。如隐藏D盘根目录下的所有文件夹和文件,但文件夹里的内容不隐藏(太费时)。
Set wshell=CreateObject("WScript.shell")
wshell.run "attrib -h c:\xxx.xxx",0
wshell.run "attrib +h c:\xxx.xxx",0是增加隐藏属性,类似的还有+r +s等等
如果要循环遍历可以用 scripting.filesystemobject