Topic: Vedit Commands on .cmd files (1 of 6), Read 13 times
Conf: Startup, File Open, Exit
From: Ian Binnie
Date: Monday, January 16, 2006 07:08 PM

I would like to include a Vedit command in a .cmd file to process a file output from another.

The following (which prepends L=" and appends " to each line) does not work, as the XP command processor mangles the commands.

-c'R(^|<^,^L="^,ALL) R(^|N^,^"|N^,BEGIN+ALL)'

< disappear (it appears to be treated as redirection)
| does different things, depending on delimiters.

Has anyone else had success using this.
I can't find any useful information on the command processor.

(I know I can save this as a macro, but this seems wasteful for such a simple application. I already have too many macros I can't remember.)

 


Topic: Vedit Commands on .cmd files (2 of 6), Read 15 times
Conf: Startup, File Open, Exit
From: Ian Binnie
Date: Monday, January 16, 2006 07:25 PM

On 1/16/2006 7:08:31 PM, Ian Binnie wrote:
>I would like to include a
>Vedit command in a .cmd file
>to process a file output from
>another.
>
I found the answer to my question:-

"The ampersand (&), pipe (|), and parentheses ( ) are special characters that must be preceded by the escape character (^) or quotation marks when you pass them as arguments."

So:-
-c`R('^|^<','L="',ALL) R('^|N','"^|N',BEGIN+ALL)`

Becomes:-
-c`R('|<','L="',ALL) R('^|N','"|N',BEGIN+ALL)`

 


Topic: Re: Vedit Commands on .cmd files (3 of 6), Read 14 times
Conf: Startup, File Open, Exit
From: Ted Green
Date: Monday, January 16, 2006 08:42 PM

At 07:25 PM 1/16/2006, you wrote:
>I found the answer to my question:-
>
>"The ampersand (&), pipe (|), and parentheses ( ) are special characters that must be preceded by the escape character (^) or quotation marks when you pass them as arguments."

Ian:

Glad you figured it out; I didn't know that (^) was the escape char in the DOS/NT prompt.

Ted.

 


Topic: Re: Vedit Commands on .cmd files (4 of 6), Read 15 times
Conf: Startup, File Open, Exit
From: Christian Ziemski
Date: Tuesday, January 17, 2006 06:08 AM


For the record:

Some infos about this can be found here (for Win XP)

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_shelloverview.mspx

and here:

http://en.wikibooks.org/wiki/Guide_to_Windows_commands


Christian

 


Topic: Vedit Commands on .cmd files (5 of 6), Read 9 times
Conf: Startup, File Open, Exit
From: Ian Binnie
Date: Sunday, January 29, 2006 01:06 AM

On 1/16/2006 7:25:39 PM, Ian Binnie wrote:
>On 1/16/2006 7:08:31 PM, Ian Binnie
>wrote:
>"The ampersand (&), pipe (|), and
>parentheses ( ) are special characters
>that must be preceded by the escape
>character (^) or quotation marks when
>you pass them as arguments."
>
>So:-
>-c`R('^|^<','L="',ALL)
>R('^|N','"^|N',BEGIN+ALL)`
>
>Becomes:-
>-c`R('|<','L="',ALL)
>R('^|N','"|N',BEGIN+ALL)`

The above worked (at least under XP, but not 98). The need to use the escape character ^ seemed a bit arbitrary.

I did some further experimentation, and came up with the following which seems to work under both OS.
-c"R('|<','L=|H22',ALL) R('|L','|H22|N',BEGIN+ALL) XALL"

The trick seems to be it use double quotes around the command string (single quotes did not work).
I needed to use |H22 for quotes within the string, but this is a lot easier to read.

 


Topic: Re: Vedit Commands on .cmd files (6 of 6), Read 10 times
Conf: Startup, File Open, Exit
From: Ted Green
Date: Sunday, January 29, 2006 04:58 PM

At 01:07 AM 1/29/2006, you wrote:
>The above worked (at least under XP, but not 98). The need to use the escape character ^ seemed a bit arbitrary.

The command.com of Win98 is much less capable than cmd.cmd of Win2K/XP. Also very different.

Ted.