I am trying to run sysprep from a vb.net application, and even though the path and file name are confirmed accurate, it is returning that it can not find the file. I've tried using process.start, declaring as a new process, declaring the path separate from the file name. Here is the code as I would like it to be written, maybe someone could try it out and see if they come up with a solution?
Private Sub btnsysp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsysp.Click
Dim P As New System.Diagnostics.Process()
P.StartInfo.UseShellExecute = True
P.StartInfo.WorkingDirectory = "C:WindowsSystem32sysprep"
P.StartInfo.FileName = "sysprep.exe"
P.Start()
End Sub
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…