views:

38

answers:

1

When my program is launched from the start menu shortcut I would like to send it a string. I see that ping does this because I can type in ping [and a domain] and it will pop the cmd window and do the ping. However I think this must be working differently than what I have setup because even though the shortcut to the program is in the start menu, it will disappear when I am searching for it as soon as I start typing any parameters. Then windows will just launch a windows explorer window attempting to search for what I typed. What must I do to get it to register like the ping program?

Also, do you think it is just using the string[] args to capture this?

A: 

Did you try running your program from CMD and passing the parameters from there? Something like: <path to your executable> <arg1> <arg2>...<arg N>

And yes, any parameters that are given to the program (as shown above) are then available in the args variable that the main method takes.

npinti
Yes it works fine from there I think Pekka (comment on question) may be on to something?
shogun