|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Passing params to an exe
I have a VB.Net Form exe application, which I wish to optionally pass command line arguments to.
How can I change the .exe so that if it is run with some parameters from the command prompt, it will process these and perhaps therefore not having to launch the form as per usual? |
|
#2
|
|||
|
|||
|
Check the COMMAND$ in a Sub Main(). Or at least that's how I'd do it in VB6.
Example: Your project. Add a Module if you don't have one, and create a new sub called Main. In there, check the variable COMMAND$. Then, if you want your form, you use: Load <form name> <form name>.Show (You can also load other forms by using Load and not use show; that way, you can make a preloader: load the "loading" form, show it, then load everything else, use the DoEvents command, unload the loading form, and show the main form!) compress.exe blah.cab blah.txt COMMAND$ will return "blah.cab blah.txt". Last edited by Kilyn : June 12th, 2003 at 06:43 PM. |
|
#3
|
|||
|
|||
|
I tried your proposed solution but have not succeeded since 'COMMAND$' is not recongnised
Neither are variations of it like 'Command'. I get the error: System.Windows.Form.Command is not accessible in this context because it is private. Any ideas? Strangely when I type 'System.Windows' I can only then select Forms (plural) not Form (singular) Namespace 'System.Windows.Forms' is available but doesnt contain a 'Command' member. |
|
#4
|
|||
|
|||
|
What??
Command$ is not a property, it's a global variable. They might have changed the name, however. Let me check. Hmm, nope, doesn't seem like it. Try having Msgbox Command$ on one line and see what that gives you. Or are you trying to send the command line paramaters while in the IDE? Check the project properties. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > Passing params to an exe |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|