Originally Posted By: bvila9999
Very nice. Thank you for this. However, this code functions the same as Allen's. It runs through, performing the task, but then KIX doesn't "end" it. It hangs at a blinking cursor without returning to a command prompt.

I think the code is "working" now that the quoting has been resolved, but KIX just doesn't appear to want to relinquish control back to the system after it runs the command. Very strange.


When you echo the command to the screen does it look exactly like the DOS command - I'm especially worried about the "%a", as the brain-dead implementation of variables in the command interpreter has caused me more problems than anything else DOS-wise.

Also, you may want to examine this from "cmd /?". If you can make any sense of it be sure to let me know what it means

 Quote:
If /C or /K is specified, then the remainder of the command line after
the switch is processed as a command line, where the following logic is
used to process quote (") characters:

1. If all of the following conditions are met, then quote characters
on the command line are preserved:

- no /S switch
- exactly two quote characters
- no special characters between the two quote characters,
where special is one of: &<>()@^|
- there are one or more whitespace characters between the
the two quote characters
- the string between the two quote characters is the name
of an executable file.

2. Otherwise, old behavior is to see if the first character is
a quote character and if so, strip the leading character and
remove the last quote character on the command line, preserving
any text after the last quote character.