I have a small console application written in C# for .NET 4.0. The application takes 2 parameters, either "-run" or "-clr". So it would be called via command line like this
MyConsoleApp.exe -run
I've tested this application in Windows 8.1 (multiple machines), Server 2012, Windows 7 and 7 SP1. I've tested it on these machines as Admin and a standard user without raised permissions. It's working in all these situations.
I have a client that is running it on Windows 7 SP1 and when they run it via command line, it is not recognizing the parameters. If they run it via Scheduled Task, it works.
The weird part is that the parameter is being read because the application will print an error in the command window indicating the bad parameter. For example
MyConsoleApp.exe -abc
Will output
Invalid switch/value found [-abc]. Program has stopped.
When the client runs the first command I mentioned with the "-run" parameter, they receive
Invalid switch/value found [-run]. Program has stopped.
They've provided a screenshot of the command window after trying to run it, and they're typing everything correctly. The application does work properly if they run it via Scheduled Task, entering the "-run" parameter in the "Add arguments" field when setting up the Action.
I initially submitted the question as a programming question here https://stackoverflow.com/questions/29109764/net-console-app-args-not-matching-case but since it works in all of my test environments and when the client uses it in a scheduled task, it doesn't appear to be something wrong in the code.
Does anyone have any idea why it may not work in the command prompt but works in a scheduled task? I thought it might have something to do with the command prompt window settings but all of the settings are specific to the look of the window. Is it possible for a third-party application (maybe an anti-virus or something) to prevent this from working properly?
EDIT: The client is definitely entering the parameter in all lower case. I have confirmed this with the screenshot they've provided.