Hey guys
Im working on creating a batch file to open my USB drive whenever i run it.
I dont want it to run AUTOMATICALLY as soon as i stick my usb in though.
I was thinking along the lines of the name of the USB.
So if i had named my USB "SpeedyUSB" it can open it.
I have some code so far that will open a certain drive letter if that drive letter is in use, this is my code:
%SystemRoot%\explorer.exe "E:\"
This opens E:\ in explorer (not Internet Explorer, just a normal window like My Music etc)
Now how do i do the same thing using my USB drive's name so that no matter what USB drive letter it has, it will always open?
Any help much appreciated,
Speedy
if exist d:\PortableApps\ %SystemRoot%\explorer.exe "D:\"
if exist e:\PortableApps\ %SystemRoot%\explorer.exe "E:\"
if exist f:\PortableApps\ %SystemRoot%\explorer.exe "F:\"
if exist g:\PortableApps\ %SystemRoot%\explorer.exe "G:\"
lol very crude but I am not a batch coder ...
Even with your proposed method you still need the help of Autorun.inf other wise what your proposing will not work
your friendly neighbourhood ex-Moderator and developer Zach Thibeau
thanks for the suggestion.
ill be tring that tomorrow thanks!
can anyone point me to a site where fairly experienced batch coders may go?
no offense but i just want to ask a professional as well.
Here's where I go:
self.path = path if self.path == None else self.path