使用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
「請幫助。」 –