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?

MetaGuru
  • 42,847
  • 67
  • 188
  • 294
  • 2
    I think you need to add the path of your executable to the `PATH` environment variable (or whatever equivalent Windows registry setting there is - haven't done Windows programming for a long time. PATH will work even in Windows 7, though). – Pekka Sep 12 '10 at 17:38

1 Answers1

0

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
  • 51,780
  • 5
  • 72
  • 96