Board logo

标题: vbs删除默认共享 [打印本页]

作者: youxi01    时间: 2007-11-5 20:03     标题: vbs删除默认共享

  1. '////作者:youxi01@bbs.bathome.net
  2. '////很早期的作品;
  3. dim wsh,suc,err
  4. suc="成功删除下列共享:"
  5. err="以下共享删除失败:"
  6. set wsh=createobject("wscript.shell")
  7. set fso=createobject("scripting.filesystemobject")
  8. set dr=fso.drives
  9. for each d in dr
  10. delchk(d.driveletter)
  11. next
  12. delchk("ADMIN")
  13. delchk("IPC")
  14. function delchk(dshare)
  15. strreturn=wsh.run("net share " &dshare &"$ /del",false,1)
  16. if strreturn=2 then
  17. err=err & dshare& vbcrlf
  18. else
  19. suc=suc & dshare & vbcrlf
  20. end if
  21. end function
  22. wscript.echo err & suc
复制代码





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