The current directory may or may not be the directory in which the
batch file resides. As long as you are using Win2000 or newer,
the system variable %cd% will always contain the name of the
current directory, so there is no need to write it to a file.
The directory in which the batch file resides is '%~dp0'.
Thank you. I've bought myself "Microsoft WINDOWS COMMAND-LINE" (Stanek) and
"Microsoft Windows Shell Script Programming for the absolute beginner"
(Ford, Harris) and am still finding my way about .bat and .cmd files.
Thank you. I've bought myself "Microsoft WINDOWS COMMAND-LINE" (Stanek) and
"Microsoft Windows Shell Script Programming for the absolute beginner"
(Ford, Harris) and am still finding my way about .bat and .cmd files.
You're welcome. Another good book is Tim Hill's _Windows NT Shell
Scripting_. I do *not* recommend Stanek's _Windows NT Scripting
Administrator's Guide_.
The two best newsgroups for batch file programming are
alt.msdos.batch.nt and microsoft.public.win2000.cmdprompt.admin. You
can find out a ton of useful information by using Google to search these
newsgroups. Also check out www.jsiinc.com, which has lots and lots of
very useful stuff.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.