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.

Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

Lee W, MVPConnect With a Mentor Technology 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
All Courses

From novice to tech pro — start learning today.