473,698 Members | 2,643 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using Process.Start with command line parameters

Rob
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.EnableRaising Events = false;
p.StartInfo.Wor kingDirectory = "C:\\AutoPM\\Au toD\\"; //**TESTING
p.StartInfo.Cre ateNoWindow = false;
p.StartInfo.Win dowStyle = ProcessWindowSt yle.Minimized;

ProcessStartInf o startInfo = new ProcessStartInf o("AutoDim.exe" , "
delay=60");
System.Diagnost ics.Process.Sta rt(startInfo);

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

Anyone have any ideas or assistance? Thanks
Aug 31 '06 #1
3 24206
Mel
it should work, but you can try adding

p.StartInfo.Arg uments = "delay=60";

"Rob" <Ro*@discussion s.microsoft.com wrote in message
news:5F******** *************** ***********@mic rosoft.com...
>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.EnableRaising Events = false;
p.StartInfo.Wor kingDirectory = "C:\\AutoPM\\Au toD\\"; //**TESTING
p.StartInfo.Cre ateNoWindow = false;
p.StartInfo.Win dowStyle = ProcessWindowSt yle.Minimized;

ProcessStartInf o startInfo = new ProcessStartInf o("AutoDim.exe" , "
delay=60");
System.Diagnost ics.Process.Sta rt(startInfo);

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

Anyone have any ideas or assistance? Thanks

Aug 31 '06 #2
Hi,

What is the problem?

IT should work fine.

--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Rob" <Ro*@discussion s.microsoft.com wrote in message
news:5F******** *************** ***********@mic rosoft.com...
>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.EnableRaising Events = false;
p.StartInfo.Wor kingDirectory = "C:\\AutoPM\\Au toD\\"; //**TESTING
p.StartInfo.Cre ateNoWindow = false;
p.StartInfo.Win dowStyle = ProcessWindowSt yle.Minimized;

ProcessStartInf o startInfo = new ProcessStartInf o("AutoDim.exe" , "
delay=60");
System.Diagnost ics.Process.Sta rt(startInfo);

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

Anyone have any ideas or assistance? Thanks

Aug 31 '06 #3

"Rob" <Ro*@discussion s.microsoft.com wrote in message
news:5F******** *************** ***********@mic rosoft.com...
>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.EnableRaising Events = false;
p.StartInfo.Wor kingDirectory = "C:\\AutoPM\\Au toD\\"; //**TESTING
p.StartInfo.Cre ateNoWindow = false;
p.StartInfo.Win dowStyle = ProcessWindowSt yle.Minimized;

ProcessStartInf o startInfo = new ProcessStartInf o("AutoDim.exe" , "
delay=60");
now you have two ProcessStartInf o objects/structures: p.StartInfo and
startInfo. Maybe you meant to set startInfo.Worki ngDirectory, etc?
System.Diagnost ics.Process.Sta rt(startInfo);

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

Anyone have any ideas or assistance? Thanks

Aug 31 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1588
by: Erik Wikström | last post by:
This is probably a stupid question but is there any easy way to get the command line parameters in a windows form? As it is now I copy the parameters into a statis string array belonging to the form but I'm quite sure that it's not the "right" way to do it. -- Erik Wikström
3
2974
by: hangten | last post by:
Does anyone know of an alternate command to invoke an executable other than Process.Start ? I have a service that invokes an executabe. But the service has minimal privs. and I'm getting an access denied error when I run the command Process.Start(executable). It works fine when the service has admin privs. but this can't be the case.. I need a command that doesn't need admin. privs. Thanks. Carol
1
1049
by: Rajiv Das | last post by:
Hi, This is the first time I am using managed cpp. However, I am unable to find how to get the command line parameters to the main function in both the console and the Application version. The IDE allows me to set command line values in Project Properties>Debug option. Can anyone give me some pointers? --------------------- Thanks Rajiv Das
5
4611
by: Tarun Mitra | last post by:
I have not been able pass the parameter with a space in an hyperlink on a ..aspx page something like <asp:HyperLink NavigateUrl="http://localhost/syskiosk/test.exe John" id="hlEditDetails" runat="server">Edit Details </asp:HyperLink> I need to know if it is possible to pass parameters to a windows .exe application through a Hyperlink? If yes then what is the best way of doing this. I also tried to pass the parameter by using a ? in...
1
2216
by: slonocode | last post by:
I have created a filter in Eudora email program that will notify a program when the criteria is met. For instance if the filter criteria is met it will send the following command: C:\MyProgam.exe "C:\MyFile.txt" I have been able to process the command line by writing a small sub main in a module and that works fine. But I need for their to be only 1 instance of the program. As it is now it opens a new instance of MyProgram.exe...
6
3217
by: bill | last post by:
I have a VB .net 2.0 site that needs to run a dos app upon a button click. I found Shell too unreliable using parameters and so used system.diagnostic.process. simple troubleshooting example that opens up Notepad.....
9
11925
by: Brad Pears | last post by:
I want to pass an integer customer# into my vb app from the command line when I run it... something like this.... c:\program files\Myapp\myvbapp.exe 100 So in the case above, when my applciation "myvbapp.exe" runs, I want to read in the integer parameter 100 (cust#) and use that value in my code to load up the appropriate data for cust# 100. How can this be accomplished in vb.net 2005??
2
4242
by: william.w.oneill | last post by:
I have an application that takes a few command line parameters. As recommended by others in this group, I'm using a named mutex to ensure that only one instance of the application is running. My question is how to elegantly pass a command line parameter from Instance_B to Instance_A where Instance_A was running prior to Instance_B. For example, the user can launch the program by passing a file name as a command line argument. The program...
1
1629
by: 85ssp | last post by:
I am working on debugging a multithreaded network application. I have two forms. One of which is my testing form, the other is the actual user form. I need to be able to load only my testing form when testing and then load my other form. I was thinking i could do this using command line parameters but i'm not sure where to put my code. If anyone has any idea on how i could accomplish this it would very helpful. Sub Main() Dim...
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8611
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8904
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8876
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4624
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.