Board logo

标题: [原创] 去除U盘文件夹隐藏属性.hta [打印本页]

作者: youxi01    时间: 2008-10-8 15:57     标题: 去除U盘文件夹隐藏属性.hta

前两天U盘中了毒,所有文件夹被病毒设置为隐藏,并添加了系统属性,不支持手动修改。
昨日,提出了在命令行下的解决办法,当然这种方法是比较简单而高效的,不过对新手来说,却并不易用,所以,今日又加紧时间做出了一个具有GUI的程序来解决这个问题(程序代码编制:vbs+hta;程序类型:hta)

1、程序运行界面:




2、直接下载程序:去除U盘隐藏属性ver1.0.hta

3、程序源代码:
  1. <!--////////程序说明/////////====
  2. Intro  去除U盘文件夹隐藏属性
  3. FileName 去除U盘文件夹隐藏属性
  4. Author  2laoshi
  5. Version  ver1.0
  6. Web  http://www.2laoshi.cn
  7. MadeTime 2008-10-8
  8. <!--//////////设置hta格式////////////-->
  9. <HTA:APPLICATION
  10. SCROLL="no"
  11. MaximizeButton="no"
  12. MinimizeButton="no"
  13. INNERBORDER="no"
  14. SHOWINTASKBAR="yes"
  15. SINGLEINSTANCE="yes"
  16. BORDER="thin"
  17. />
  18. <!--//////////样式设置////////////-->
  19. <style type="text/css">
  20. a:link {color: blue}
  21. a:visited {color: blue}
  22. body  {background: #EEEEEE}
  23. #content{font-size:14px;margin-top:-15;font-family: "隶书";padding:2px;border:1px solid #BEBEBE;height:80;}
  24. #contain{text-align:center;margin-top:3;height:10;}
  25. #footer{text-align:center;font-size:14px;color:#333333;font-family: "隶书";margin-top:5}
  26. </style>
  27. <!--/////////////代码区//////////////-->
  28. <script language=vbs>
  29. Sub Window_onLoad
  30. window.resizeTo 300,210
  31. ileft=(window.screen.width-300)/2
  32. itop=(window.screen.height-200)/2      
  33. window.moveTo ileft,itop      
  34. End Sub
  35. Sub GetDriveName
  36. '先清空原来的U盘盘符列表
  37. for i=0 to Mydrive.length-1
  38. Mydrive.remove(i)
  39. next
  40. '获取、添加U盘盘符列表
  41. Set wmi=GetObject("winmgmts:\\")
  42. set drives=wmi.instancesof("Win32_LogicalDisk")
  43. for each drive in drives
  44. set obj=document.createElement("option")
  45. if drive.drivetype=2 then
  46.   obj.text=drive.caption
  47.   obj.value=drive.caption
  48.   Mydrive.add obj
  49. end if
  50. next
  51. if Mydrive.length>0 then
  52. start.disabled=false
  53. else
  54. alert("很遗憾!没检测到U盘")
  55. end if
  56. End Sub
  57. Function ToggleAttribute(drive)
  58. Dim fso, f
  59. set wsh=createobject("wscript.shell")
  60. Set fso = CreateObject("Scripting.FileSystemObject")
  61. Set f= fso.GetFolder(drive&"\")
  62. Set fc = f.SubFolders
  63. for each folder in fc
  64. if folder.attributes and 4 then
  65.   folder.attributes=folder.attributes-4
  66. end if
  67. if folder.attributes and 2 then
  68.   folder.attributes=folder.attributes-2
  69. end if
  70. next
  71. alert("恭喜您!已经去除U盘隐藏文件夹属性")
  72. End Function
  73. Sub start_onclick
  74. ToggleAttribute(Mydrive.value)
  75. start.disabled=true
  76. End Sub
  77. </script>
  78. <!--//////////版面设计区////////////-->
  79. <body topmargin="6" rightmargin="4" leftmargin="4" oncontextmenu=javascript:return(false)>
  80. <title>去除U盘文件夹隐藏属性</title>
  81. <h5 align="center"><font color=red>去除U盘文件夹隐藏属性</font></h5>
  82. <div id="content">
  83. <font color=blue>1、功能说明</font>:</br>
  84. 去除U盘文件夹属性(针对病毒),包括隐藏、系统、只读属性。</br>
  85. <font color=blue>2、注意事项</font>:使用前,请先点击"获取盘符"</br>
  86. <font color=blue>3、选择移动硬盘</font>:<select style="width:45px" ID="Mydrive"></select>
  87. </div>
  88. <div id=contain>
  89. <input type=button value=获取盘符 onclick=GetDriveName>
  90. <input type=button name=start value=开始 disabled>
  91. <input type=button value=退出 onclick=self.close>
  92. </div>
  93. <div id=footer>
  94. Code by <a href="http://www.2laoshi.cn" title="访问我的博客">2laoshi</a>
  95. </div>
复制代码





欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2