Getting current drive name of the running batch file???

Hi, how can I get the name of the drive which the running batch file is located?
Since I am going to run the batch file in a CD-rom or floppy, but I need the name of that drive.  Is this possible?? Thanks.

yours,
armansiu
armansiuAsked:
Who is Participating?
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
In a batch file, this will set the variable "CurDrive" to be equal to the drive letter you're currently on.

for /f "tokens=1 delims=\" %%a in ('cd') do set CurDrive=%%a
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.