1.

Solve : CD Drive Variable?

Answer»

I wrote a batch, which was burned to a CD to LINK to several install programs ALSO on the CD so my FREINDS COULD just stick the cd in, and it would auto run this file. The file is as follows:

echo off
call D:/data/first/install1.exe
pause
call D:/data/second/install2.exe
pause
call D:/data/third/setup.exe
pause
exit

Very crude and simple, yet efficiant.

I burned the CDs and everything worked just fine. Yet, it only worked on computers with the CDROM drive they were using was D:/ . I want to have some sort of variable LIKE the '%windir%' variable to goto the CDROM

ThanksOkay, all you have to do is:

Just don't put in D:

I had used to have a hard time with the different drive letters for different computers until I discovered this simple way. You don't even need to use a variable!
Oh, also you don't need to use forward slashes, you can use backslashes too.

So your batch file would look something like this now:

echo off
call \data\first\install1.exe
pause
call \data\second\install2.exe
pause
call \data\third\setup.exe
pause
exit

-----
Thank me later...



Discussion

No Comment Found