Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / August 2006

Tip: Looking for answers? Try searching our database.

Using Process.Start with command line parameters

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rob - 31 Aug 2006 15:30 GMT
I have an app that calls an eternal EXE using process.start.  My issue is I
have a couple command line parameters that need to be put in, so that it
would read:

    Process p = new Process();           
    p.EnableRaisingEvents = false;
    p.StartInfo.WorkingDirectory = "C:\\AutoPM\\AutoD\\"; //**TESTING
    p.StartInfo.CreateNoWindow = false;
    p.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;

    ProcessStartInfo startInfo = new ProcessStartInfo("AutoDim.exe", "
delay=60");
    System.Diagnostics.Process.Start(startInfo);

Where the delay=60 is the command line param values.

Anyone have any ideas or assistance?  Thanks
Ignacio Machin ( .NET/ C# MVP ) - 31 Aug 2006 15:58 GMT
Hi,

What is the problem?

IT should work fine.

Signature

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

>I have an app that calls an eternal EXE using process.start.  My issue is I
> have a couple command line parameters that need to be put in, so that it
[quoted text clipped - 13 lines]
>
> Anyone have any ideas or assistance?  Thanks
Mel - 31 Aug 2006 16:12 GMT
it should work, but you can try adding

p.StartInfo.Arguments = "delay=60";

>I have an app that calls an eternal EXE using process.start.  My issue is I
> have a couple command line parameters that need to be put in, so that it
[quoted text clipped - 13 lines]
>
> Anyone have any ideas or assistance?  Thanks
Ben Voigt - 31 Aug 2006 18:52 GMT
>I have an app that calls an eternal EXE using process.start.  My issue is I
> have a couple command line parameters that need to be put in, so that it
[quoted text clipped - 8 lines]
>     ProcessStartInfo startInfo = new ProcessStartInfo("AutoDim.exe", "
> delay=60");

now you have two ProcessStartInfo objects/structures: p.StartInfo and
startInfo.  Maybe you meant to set startInfo.WorkingDirectory, etc?

>     System.Diagnostics.Process.Start(startInfo);
>
> Where the delay=60 is the command line param values.
>
> Anyone have any ideas or assistance?  Thanks

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.