can't run process

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi

i like to start the the following commandline using
processstartinfo.arguments and process.start.
well, nothing happens. entering this line directly inside a command-shell
works fine. so, what am i doing wrong?

best regards

georg

command: "C:\Temp\lmutil.exe lmstat -a -c A.lic > C:\Temp\A.txt"
 
You have to seperate the actual filename and arguments.
Put the "C:\Temp\lmutil.exe" in the FileName property and the rest in the
Arguments property.
You should also set the "UseShellExecute" to true.

Chris
 
hi chris

tx for your reply. i tried the following code (without success)

Dim pProcess As New Process
Dim pProcessInfo As New ProcessStartInfo
pProcessInfo.FileName = "C:\Temp\lmutil.exe"
pProcessInfo.Arguments = " lmstat -a -c ARCINFO9.lic > C:\Temp\A.txt"
pProcessInfo.UseShellExecute = True
pProcess.StartInfo = pProcessInfo
pProcess.Start()

executing this code opens a shell for verry short time but nothing is
processed. could it be a problem, that i'm trying to pass multiple arguments
in just one string?

best regards

georg
 
Can't see that muliple arguments should have anything to do with it.

The Process class has a WaitForExit() method, try this and then check the
ExitCode property,
it might be that something else is going wrong.
You could also redirect the StandardError and StandardOutput streams into a
file so you can see any error messages.

Chris
 
Back
Top