Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: CD Drive Variable  (Read 2876 times)

0 Members and 1 Guest are viewing this topic.

diskos

  • Guest
CD Drive Variable
« on: April 14, 2004, 06:47:31 PM »
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

Thanks

Erifash

  • Guest
Re: CD Drive Variable
« Reply #1 on: April 15, 2004, 03:06:04 PM »
Okay, 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...