Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Force For to treat set of values as text, not files

Jun
770
6
How can I force the For command to treat the set of values as strings rather than files? Consider the following btm file:

for /t" " %X in (%@right[-%@len[%@field[0,%cmdline]],%cmdline]) (echo %X)

If I run this with an argument of *, it will print out a list of the files in the directory. I want it to just print *.

The purpose of this is that I want to make some changes to the command line (e.g., add some default parameters), then run a program using the modified command line.
 
> How can I force the For command to treat the set of values as strings
> rather than files? Consider the following btm file:
>
> for /t" " %X in (%@right[-%@len[%@field[0,%cmdline]],%cmdline]) (echo
> %X)
>
> If I run this with an argument of *, it will print out a list of the
> files in the directory. I want it to just print *.
>
> The purpose of this is that I want to make some changes to the command
> line (e.g., add some default parameters), then run a program using the
> modified command line.

Any reason you feel compelled to do this in FOR rather than DO?

Rex Conn
JP Software
 

Similar threads

Replies
4
Views
2K
Back
Top