Execute an EXE file with command line parameters from .net CF Application

  • Thread starter Thread starter MBadawi
  • Start date Start date
M

MBadawi

Hi every one..

I'm facing some trouble trying to run an exe file from my .net code
(C# code)!

I succeeded running (myApp.exe) but what i need is to pass command
line parameters along with the app ("\program files\myApp.exe param1
param1 ..")
any idea how can I do that?

p.s. I used createProcess function to run the app, and I tryed
shellexecute and i couldn't get the hang of it

any help would be appreciated, thanx alot
 
The second parameter of CreateProcess is a string argument for command line
arguments. So you would pass all your arguments in here e.g. "param1 param2"
If your argument is a file path, you should enclose it in quotes, otherwise
if it contains spaces it will not be passed correctly to the application
e.g. C#
CreateProcess("\\Program Files\\myApp.exe","\"\\My
Documents\\SomeDoc.txt\"", etc
or for VB
CreateProcess("\\Program Files\\myApp.exe","""\My Documents\SomeDoc.txt""",
etc

Peter


--
Peter Foot
Windows Embedded MVP
www.inthehand.com

Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups
 
Back
Top