Option Explicit 
  
  Private Sub Command1_Click() '设置共享 
  Dim wsh As Object 
  Set wsh = CreateObject("Wscript.shell") 
  wsh.run "net share AAA=D:\SQLXML", 0 
  Set wsh = Nothing 
  
  End Sub 
  
  Private Sub Command2_Click() '取消共享 
  Dim wsh As Object 
  Set wsh = CreateObject("Wscript.shell") 
  wsh.run "net share AAA /delete", 0 
  Set wsh = Nothing 
  End Sub
这段代码是设置本地共享目录的,请帮我分析一下,最好写的详细一点。
本人看不懂,谢谢

解决方案 »

  1.   

    创建一个shell对象. 执行2条shell命令. 执行完毕 set nothing释放资源
    其实就在下面2条shell命令中实现啊 
    net share AAA=D:\SQLXML  将D:\SQLXML创建一个名AAA的共享 ,
    net share AAA /delete    删除名AAA的共享你可以到命令行方法 net share /help 获取更详细的帮助
      

  2.   

    Set wsh = CreateObject("Wscript.shell") 
    是什么意思,是个什么对象
      

  3.   

    WScript 是window的脚本宿主,它通俗说就是windows的批处理程序,它可执行vbscript和javascript编的程序!!!很有用的!!!!