Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch file, open the cd rom....

Status
Not open for further replies.

LastWords

IS-IT--Management
Oct 15, 2001
93
0
0
GB
I'm creating a batch file with an autorun.inf to open the contents of a cd rom we are producing. The cd contains a website on it which I need the index.asp to open in the clients browser.
I have successfully created a simple but effective batch file like: start iexplore.exe D:\Index.asp. But a problem might occur if the clients pc uses a different letter for the cd rom drive (i.e anything other than D: wont execute index.asp). Is there a dos command that defaults the cd rom drive? Or is there another way of doing this that I'm not thinking of?

Thanks in advance.
by Lastwords,

Maentwrog (n.Welsh): Celtic word for a computer spelling mistake.
 
I tried something like this about a year ago. I don't have the exact documentation, but I remember being able to omit the drive letter in some instances. If I had "Welcome.exe" in a folder named "Other" on the CD, I could simply include "\Other\Welcome.exe" in my autorun.inf file. Now since you're using the "Start" command, I don't know if it'll work, but it's worth a shot. Good luck.
 
Don't think there are any dos commands, but I'd think there would be a reference in the registry (can't check right now because my work machine doesn't have a CDROM) You could always prompt the user for the CDDrive in the batch file...

The one thing I'd like to point out is that having the explorer open the ASP file will not allow it to be processed. ASP needs to be passed through a web server (IIS or PWS) to process the server side code (anything within the <% %> tags).

Also, I'd suggest that you take into consideration users who prefer netscape or other browsers...
 
Thanks for your quick replies, Bwsysadmin, im still thinking of what you actually mean.
Garwain, how do you prompt the user with a batch file, pause or something?
ANd yes I've realised that asp has to be passed through a web server but these files are hard coded so that wont be a problem. And people with Netscape will miss out on this one unfortunetly ;) by Lastwords,

Maentwrog (n.Welsh): Celtic word for a computer spelling mistake.
 
it's been a while since I have worked with batch files but after a couple minutes of testing I came up with:
Code:
@ECHO OFF
SET MyInput=
IF NOT '%1'=='' GOTO Ready
SET /P MyInput=Enter the drive letter for your CD-ROM:
%0 %MyInput%
:Ready

echo CDROM is %1

I saved that as test.bat and called it
c:>test.bat D
and
c:>test.bat

if you don't provide the argument it'll ask for the drive letter.

Hope this does the trick for you.

 
How about plagarizing the the script off the win98 bootdisk for &quot;Start with CD-ROM support&quot;. I think there's a little routine for determine where the cd-drive is.
 
Here is one way. You'll need a copy of choice.com.

@ECHO OFF
CD ¦ CHOICE /N /C:ABCDEFGHIJKLMNOPQRSTUVWXYZ SET curdrive=>%temp%.\curdrv$.bat
FOR %%A IN (CALL DEL) DO %%A %temp%.\curdrv$.bat
ECHO &quot;%curdrive%&quot;

Kevin Mattson
MCP
 
Are you doing the batch file and having the autorun.inf call the batch file? If that's the case, you should be able to have the autorun.inf open the webpage without the batch file.

Try:

[autorun]
shellexecute = index.asp

From the autorun file, if the file you are referring to is on the same drive, you shouldn't need to reference a drive letter. So, for instance, if the index.asp was in the Other folder off the root of the CD, you could do:

[autorun]
shellexecute = \Other\index.asp

(I don't remember if you would need the backslash in front of Other or not.)

The only problem with shellexecute is that it will open up whatever their default browser is.

If that's not what you're trying to do, my apologies.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top