Consultor Eletrônico



Kbase P134826: Error from OS-COMMAND when command parameters are quoted strings
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/13/2008
Status: Unverified

SYMPTOM(s):

Error from OS-COMMAND when command parameters are quoted strings

Error from OS-COMMAND when parameters contain long file names

Error from OS-COMMAND when parameters have spaces in file names

Code in a form like this:
cCommand = "~"C:\Program Files\Windows NT\Accessories\wordpad.exe~" ~"C:\Documents and Settings\test.txt~"".
os-command value (cCommandLine).
produces the following error message:

'C:\Program' is not recognized as an internal or external command, operable program or batch file.

A command string in a form like this:
cCommand = "~"wordpad.exe~" ~"test.txt~"".
also produces the error.

FACT(s) (Environment):

A command string in a form like this:
cCommand = "wordpad.exe ~"test.txt~"".
does not produce the error.
The commands that produce the error when run from OS-COMMAND work correctly when run from the command line, with both the command and the parameter in quotes.
Windows
Progress 9.x
OpenEdge 10.x

CAUSE:

This issue is reported in the Microsoft knowledge base. When applications with long file names in the path are launched with the Start command, each long file name in the path must be quoted separately.

FIX:

Quote each long file name in the application path separately. When this is done, any application parameters can be quoted as a whole. As an alternative, place the entire command string in a batch file with no parameters, and run the batch file using OS-COMMAND.