vb.net process.start() netdom and arguments dont seem to work.

B

brett

Hey,

When I run this code i seem to always get exit code 87 or 1.
I am going to assume its an issue with the way the arguments string
(args) is setup but i cant for the life of me see whats wrong at this
moment. Anyone with a fresh set of eyes see the issue?

CODE:

Dim args = "RENAMECOMPUTER " & cn_orig & " /NewName:" & cn_label.Text
& " /UserD:" & x_un & " /PasswordD:" & x_pw & " /Force /Reboot:" &
shutdown_time

' create a new process
Dim myProcess As Process = System.Diagnostics.Process.Start("c:\windows
\system32\NETDOM.exe", args)

' wait until it exits
myProcess.WaitForExit()

' display results
MessageBox.Show("CMD was closed at: " & myProcess.ExitTime & "." &
System.Environment.NewLine & "Exit Code: " & myProcess.ExitCode)

myProcess.Close()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top