Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

run_managed arguments

Genius
Genius

Hi All,

 

Do you know how can I pass arguments to an exe (or Dll) if I started it with run_managed.exe?

 

var processInfo = new ProcessStartInfo(runManagedPath, startpath);

 

Many Thanks

 

2 REPLIES 2

Re: run_managed arguments

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

I have a journal that converts part units by calling the external program ug_convert_part.exe. I pass in the arguments with the ProcessStartInfo.FileName property.

 

Dim convertProcess As New Process

Dim myStartInfo As New ProcessStartInfo
myStartInfo.UseShellExecute = False
myStartInfo.CreateNoWindow = True
myStartInfo.FileName = """" & convertPath & """" & unitArg & """" & partPath & """"
myStartInfo.RedirectStandardOutput = True
myStartInfo.RedirectStandardError = True

'lw.WriteLine("""" & convertPath & """" & unitArg & """" & partPath & """")
convertProcess.StartInfo = myStartInfo
convertProcess.Start()

Re: run_managed arguments

Genius
Genius

oh man so simple.... Smiley Very Happy thx

 

if someone search the code:

var processInfo = new ProcessStartInfo();

processInfo.Filename= runmanagedPath;

processInfo.Arguments = myexepath + " 5";

var process = Process.Start(processInfo);

 

actually It is also posssible with: (the target journal has to have an input stream)

processInfo.RedirectStandardInput = true;

processInfo.Filename= runmanagedPath;

processInfo.Arguments = myexepath;

var process = Process.Start(processInfo);

process.StandardInput.Write("5");

 

but (probably) because of threading things it does not start until I close the window where i called the run_managed.exe.