Click to See Complete Forum and Search --> : DOS batch: how to get drive and path


oob2
January 17th, 2003, 06:17 PM
How to get the drive and path information of the batch file currently running?


Let say if I am in D:\temp, and I want to run a batch file under C:\aaaa\bbb\c.bat

D:\temp>

Then, I type:

D:\temp\>C:\aaaa\bbb\c

I expect to get result like this:

D:\temp\>C:\aaaa\bbb\c
Drive is C
Path is \aaaa\bbb
Filename is c.bat
File extension is bat


How to do this?

Thanks.

lord loh
January 22nd, 2003, 01:50 AM
Dear oob2,

These commands that I am telling you work on win2000! Dont know of the rest.

>> "vol" gives volume label and drive letter.
>>"cd" gives the path(all dos, I am sure!)

I could not figure out the file name part.

Hope this helps.