Computer Hope
Microsoft => Microsoft DOS => Topic started by: jagdale on September 20, 2004, 01:35:50 PM
-
Hi all,
I have a file called myfile.bat in the C:\A\B directory. The file is normally run from C:\A not the file's directory of C:\A\B. I want to set a variable within myfile.bat to know that it is in C:\A\B. How do I do this?
When I try %cd% I always get "C:\A" since that's the working directory.
Any help would be appreciated. FYI, I am using Windows XP.
Thanks,
Ajit
-
use the "if exist c:\a\b\myfile.bat "
then take some action based on findings
-
forgot to set the variable..
"if exist c:\a\b\myfile.bat set filefound = T "
now the variable %filefound% contains the result.