使用PsExec。
下面是一个例子代码:
Dim application As String = "\\SHOP" & box & TextBox1.Text & "\E\VastUpdate\AutoITUpdater.exe"
Dim arguments As String = "/i AutoITUpdater.exe"
Dim location_of_psexec As String = "c:\pstools\psexec.exe"
Dim remote_machine As String = "remote_machine"
Dim process As Process = New Process()
process.StartInfo.UseShellExecute = False
process.StartInfo.CreateNoWindow = True
process.StartInfo.FileName = location_of_psexec
process.StartInfo.Arguments = String.Format("\\{0} -c ""{1}"" ""{2}""", remote_machine, application, arguments)
process.Start()
我假定在我的代码,所述应用程序的路径(例如"\\SHOP" & box & TextBox1.Text & "\E\VastUpdate\AutoITUpdater.exe"
)是相对于你的机器,而不是在远程机器。
如果你想使用相对到远程机器的路径,简单地从取出的process.StartInfo.Arguments
值去掉
-c
“请帮助。” –