see an example using ShellExecute:http://vbaccelerator.nuwebhost.com/codelib/shell/shellex.htmuse a command likeShellEx "net", , "use r: \\" & ip & "\d$ " & passwd & " /user:" & user, , , Me.hWnd

解决方案 »

  1.   

    ShellExecute Me.hWnd, "open", "net.exe", "use //" & ip & "\d$ " & passwd
      

  2.   

    ShellExecute Me.hWnd, "open", "net.exe", "use //" & ip & "\d$ " & passwd什么意思啊
      

  3.   

    http://vbaccelerator.nuwebhost.com/codelib/shell/shellex.htm下载了方便啊!
      

  4.   

    ShellExecute Me.hwnd, "open", App.Path & "\help.chm", "", "", 1
    这个是我在菜单打开帮助用的
     saucer(思归, MS .NET MVP) 说的好像很对
    试试先
      

  5.   

    我试了一下
    CMD窗口一闪就没了
    是不是应该调用CMD.EXE?
      

  6.   

    你调用的api声明是函数格式(function)不能,没有返回变量,basic不允许这种调用方式。
    x=ShellExecute( Me.hWnd, "open", "net.exe", "use r: //& ip &/d$ " & passwd)
    就ok了
      

  7.   

    ShellEx "net", , "use r: \\" & ip & "\d$ " & passwd & " /user:" & user, , , Me.hWnd
    这里运行时说‘子函数未定义’
      

  8.   

    copy the defintion from the following link to a module:http://vbaccelerator.nuwebhost.com/codelib/shell/shellex.htm
      

  9.   

    那~~~~应该是copy那一段吖???
      

  10.   

    这是basic,不是c/c++函数必须写返回变量!
      

  11.   

    Call Shell("net.exe use r: //& ip &/d$ " & passwd & " /user:" & user & "")ShellExecute me.hwnd,"open","net.exe","use r: //& ip &/d$ "& passwd &" /user:"% user %","",1其他的不用我多说了吧!!!