Cmd
From Wine-Wiki
Contents |
Introduction
Wine's version of the dos command prompt, cmd was apparently written to emulate the functionality of DOS 6, though some later features have since been added. Origionally known as wcmd, since Sept 06 it has been renamed as cmd wine source archive
cmd or wcomd opens a command prompt where you can type dos commands such as type or dir. One use is to run bat files
[Dec 2003] The "/c" syntax is supported, to execute one command then exit, but not "-c".
an example from Wine Weekly News: you may put it in a shell script, if you like. output is to stdout (no window is created). archive link
wcmd /c batfile
Forum Comments
T. Kho: Window's cmd.exe run under Wine seems to do exactly what wcmd.exe currently does in that it runs in its original terminal without creating a new console window. Creating the console to host cmd.exe is likely ouside the scope of cmd.exe. Also, running cmd.exe from within an instance of cmd.exe in Windows does not open a new console window. Using an existing console, be it unix or dos, seems to be the right thing to do.
A user noted: wineconsole by itself doesn't seem to do anything, and using --help didn't work (and there seems to be no man page). Running
wineconsole wcmd.exe'
started a command prompt in the activating terminal just like wcmd.exe normally does, except the console output is forced to 80x25 output with no back buffer (Windows' cmd.exe can have a configurable-sized back-buffer and can be resized), and the error/fixme/trace's from the apps run from it are displayed improperly (I suppose because they end lines with \n, and in wineconsole's console it needs \r\n).
J. Hawkins: try 'wineconsole --backend=user wcmd.exe'. Works great for me. wine archive
T. Kho [Jun 06]: I'm currently looking into what would be required for something like a symlink to wcmd.exe, but at the same time I'm wondering the historical reasons for choosing 'wcmd' and if it should be changed to just 'cmd'.
A. Julliard: Yes, I think it should be renamed to cmd.exe, at this point it's supposed to be a complete replacement.
T. Kho asked:should it be a wholesale s/wcmd/cmd or should wcmd keep the name wcmd with just the executable name changed? [Ed.as of Jun-Jul 06 a patch was not seen in cvs but seems likely.]
Paul [Mar 06] wine archive noticed a regression: If I start two 16 bit programs in wcmd or in the original case use wintask to start a Delphi 1 based GUI the second program does not get a new thread detach. As soon as the switch occurs back to the original task a page fault occurs. See bug for traces, more details and sample program. http://bugs.winehq.org/show_bug.cgi?id=4897
D. Kegel [Apr 06]: some installers use it under the hood. [However] Things like
- if "%1" == "%2" and
- the /wait commandline flag are not yet implemented.
It wouldn't be all that hard to get wcmd far enough along to make those installers happy; [He suggested] it'd make a good SoC project.wine archive
A user [Nov 2005] reported a crash using the set command. R. Klazes offered a patch which fixed the issue, and was committed to CVS the next day. wine archive
A user asked [Nov 2005] if wine supported .bat files. W. Ogburn: Try "wcmd" or "wineconsole." wine archive
Tips and Tricks
M. McCormack: cmd.exe uses CreateProcess by default, and ShellExecute if you use "start". wine archive
D. Kegal [Dec 2005]:[apparently there is] a bug in wine's wcmd, [...] wcmd probably [...]doesn't support quotes properly. link to D. Kegel Website with examples and comments

