Vb.net PSExec找不到指定的文件

Vb.net PSExec找不到指定的文件,vb.net,psexec,Vb.net,Psexec,我已经使用远程工具PSEXEC一段时间了。非常好的工具,在命令行中非常有效。但是,我无法让它在按钮上工作。请在VB.NET中单击 命令行(工作正常) 这是我的VB.Net代码 Try Dim p As New Process() p.StartInfo.FileName = "C:\path to\PsExec" p.StartInfo.Arguments = "\\ComputerName -h -i -s \\FileServer\Share$\ .exe f2C:\

我已经使用远程工具PSEXEC一段时间了。非常好的工具,在命令行中非常有效。但是,我无法让它在按钮上工作。请在VB.NET中单击

命令行(工作正常)

这是我的VB.Net代码

Try
    Dim p As New Process()
    p.StartInfo.FileName = "C:\path to\PsExec"
    p.StartInfo.Arguments = "\\ComputerName -h -i -s \\FileServer\Share$\ .exe f2C:\psexeclog.txt -f1\\FileServer\Share$\setup.iss"
    p.Start()
Catch ex As Exception
    MessageBox.Show("Could not compete action")
End Try
这连接到计算机名很好!错误是何时远程运行.exe

错误:Psexec无法在ComputerName上启动\FileServer\Share$\.exe系统找不到指定的文件


上面的命令行命令非常有效。为什么vb.net没有编码?

尝试将每个参数都放在
.Arguments
-string中的双引号中。系统帐户可能无权访问
\\FileServer\Share$
Try
    Dim p As New Process()
    p.StartInfo.FileName = "C:\path to\PsExec"
    p.StartInfo.Arguments = "\\ComputerName -h -i -s \\FileServer\Share$\ .exe f2C:\psexeclog.txt -f1\\FileServer\Share$\setup.iss"
    p.Start()
Catch ex As Exception
    MessageBox.Show("Could not compete action")
End Try