wcmd: strip quotes around executable and retry on error

Thomas Kho tkho at ucla.edu
Tue Jul 11 14:01:35 CDT 2006


On 7/11/06, Robert Shearman <rob at codeweavers.com> wrote:
> Thomas Kho wrote:
>
> > On 7/6/06, Thomas Kho <tkho at ucla.edu> wrote:
> >
> >> wcmd: strip quotes around executable and retry on error
> >> wcmd currently gives a 'File not found' error for the command:
> >> `./wine wcmd /c "notepad test.txt"` because it only tries to execute the
> >> program "notepad text.txt". In XP, cmd.exe starts notepad.exe with
> >> test.txt as
> >> its argument upon not finding a "notepad text.txt" executable.
> >
> >
> > Hi,
> >
> > Is there something wrong with this patch?
> > http://www.winehq.org/pipermail/wine-patches/2006-July/028367.html
>
>
> It could probably be fixed by creating a fake notepad.exe in C:\Windows
> or C:\Windows\system32 instead of duplicating some of the work of
> CreateProcess.

A fake notepad.exe is currently created in c:\windows\system32. I
don't think there's duplication of CreateProcess because CreateProcess
considers the filename of the executable to be the first quoted term
in the commandline. In contrast, cmd.exe also considers the first
space-separated word of that quoted string as the filename of the
executable when the entire quoted term is not an executable.

Thomas Kho



More information about the wine-devel mailing list