How can we change the path of a batch file (.bat) ?
A:
Are you talking about changing the path of a command within the batch file? If yes then pass the path as an argument.
Hope I understood your question.
griegs
2010-07-26 06:22:01
+1
A:
I've got a feeling it is about changing the current working directory.
To do that, use the command cd
to change current working directory.
e.g.
@echo off
C:\
cd C:\Windows\System32\
If you change both the current drive and the current directory you'll need the /D
switch:
cd /D D:\Foo
thephpdeveloper
2010-07-26 06:24:09
I think the 2nd line (c:\) shouldnt have \ at the end if you are trying to switch drives.
fedmich
2010-07-26 07:40:25
A:
Firstly, make sure you change the drivename to. then use cd command
c:
cd "c:\windows\"
fedmich
2010-07-26 07:38:56
A:
cd /d d:\foo
or, if you want to jump back to the source directory
pushd d:\foo
with
popd
you switch back to the directory before the pushd
john_doe
2010-07-26 07:57:28