ProcessStartInfo给出错误:系统找不到指定的文件

时间:2014-06-11 02:13:59

标签: vb.net process

我想运行一个配置计算机的命令行,但一直收到错误系统找不到指定的文件。但是,当我通过cmd运行代码时,它可以工作。

以下是代码

    Public Sub DjoinExe()
    Dim myProcessProperties As New ProcessStartInfo
    Dim strArguments As New StringBuilder
    myProcessProperties.FileName = "C:\Windows\System32\djoin.exe"
    If strArguments.Length <> 0 Then
        myProcessProperties.Arguments = " /provision /domain blablabla.com /machine machineName /reuse /savefile C:\Apps\offlinedomainjoin.txt "
    End If
    Dim myProcess As Process = Process.Start(myProcessProperties)

End Sub

提前致谢

0 个答案:

没有答案
相关问题