I have a batch file which is on a usb key. I need to know the drive name the batch is in.
Example, if it\'s E:\\mybatch.bat it should find E:\\ same thing for F:\\, G:\\
If run from inside a .CMD/.BAT file, you can use %~dp0 to get the current/working directory. This one is a little safer as it is aware of UNC paths and such. Reference for the syntax of that variable is available here.
%~dp0