I’m trying to pass arguments/parameters from a batch file to a simple C# Console.Writeline(args[0]) program.
My program’s exe file has a two-word name with a space and that’s the problem! The whole thing only works when I rename the exe file to a whole word and write start SchoolBook.exe OMG and the arg[0] then becomes equal to “OMG”.
But in any other case the program won’t start.
- If I leave it start School Book.exe OMG it says “Windows cannot find “School”.. “
- If I put double quotes:
start "School Book.exe" OMGit says “Windows cannot find “OMG”.. “ - If I put single quotes it can’t find “School”
- I tried putting a ‘-‘ before the OMG, putting quotes around the OMG, even putting
%1%before it NO! Nothing works..
Any help?
Thank you in advance!
I just created an empty command application “School Book” which when built produces the executable
School Book.exe.My pretty empty implementation:
In my command box I can execute the program like this:
Now a messagebox pops up with “OMG”