cmd dir info
"Tem" <tem1232@yahoo.com> wrote in message news:es5jgeQDIHA.4308@TK2MSFTNGP06.phx.gbl...
It already searches the subdirectories.
The starting directory can be changed by changing 'c:\106x' to the directory
you wish. Enclose the name in double-quotes if it contains spaces.
For "the directory where the batch file resides", try
"%~dp0"
in place of c:\106x above
OR, to specify a directoryname on the command line, use
"%~1"
in place of c:\106x above
You can execute the batch by placing it in any directory in your "path"
(simply execute the command
PATH
from the prompt.)
If you use batch regularly, you may wish to establish a dedicated directory
for your .bat files and include it in your PATH permanently. Popular names
include C:\bat , c:\batch and c:\belfry.
To output to a file rather than the screen, add
after the appropriate ECHO keyword
......(echo !ysd!>filename)...
above.
If your filename includes spaces, you'd need to enclose the name in
double-quotes.
Being new to .bat syntax isn't a crime. Top-posting in newsgroups however,
is. Top-posting (replying before the existing message text) is normal for
email. In newsgroups, you're likely to find that persistent top-posting will
lead to your being ignored.
As I said, try the newsgroup alt.msdos.batch.nt where you'll find many
examples and even the occasional FAQ.
|