Click here to Skip to main content
15,894,896 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all,

I still use console programs that I develop under Microsoft Visual Studio 2008. I recently changed to Windows 7 and I found that when you use the following Main call:
C#
public static void Main(string[] args)
{
}

And you issue the command

C:>myprog -l

For Windows XP args[0] will give the first parameter "-l", while in Windows 7 I see the program name myprog in args[0]. I have searched the questions here at the code project but I could find no reference to this. I cannot be the first one to stumble on this, so who knows more about it?

Regards,
Harm
Posted
Updated 11-Feb-10 6:15am
v2

You do not specify which language you are using but I assume from the above that it is C#. I have just tried this on Wndows 7 and it works correctly, the first parameter is "-l". I can only assume something else is causing this on your system.
 
Share this answer
 
If this is so, there is nothing you can do rather than check what Operating system the program is using.

I dont know if there is any other option to this. If so, I would definitely like to see.

:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900