Running cmd.exe from within Cygwin

/? is treated as a pattern by bash, where the question mark will fit a single character, so if you have any one-letter files or directories in your Cygwin root, the pattern will be replaced with those. echo /? will show you if that's what's happening. You can escape the question mark with a backslash: /\?. Or quote the whole argument: '/?'.

cygstart c:/windows/system32/cmd will start cmd.exe in its own window.


You can run a batch file from a Cygwin shell directly, you don't even need the intermediate call to cmd. If the batch file requires arguments, they need to be quoted in the Windows fashion; it might be simpler to run cmd /c 'foo.bat "quoted arguments"'.

You don't say in what terminal you're running the shell. Batch files by themselves don't care about that, but the commands that are executed from the batch files might. Cygwin terminal emulators do not emulate Windows consoles, so they are good for Cygwin programs and for stdio-only programs but not for Windows console programs.

If normally run Cygwin shells in a Cygwin terminal (such as rxvt or mintty), You can run the trouble batch files in a separate Windows console with start foo.bat. You might want to run Console2 as a better replacement for the Windows console, and run Windows console applications in Console2 and Cygwin applications in a Cygwin terminal (or even in Console2).

cmd /? is a red herring: there are presumably one-character-long directories in the Cygwin root directory, so the shell expands /? and runs cmd with switches that happen to produce no output.