I have a problem with the CD-ROM drive letter. I have a product running from a CD. This product does not allow you to call a file by just entering "folder\file.123" you have to enter the full path, "e:\work\folder\file.123".
As this is running from a CD this causes a problem, because the CD drive is not always e:, it could d:. I have found a way of creating a work drive using VB script. This pops up a prompt asking the user to specify what drive letter the CD is on and then it creates a duplicate drive called z: which is the sames as the CD (A bit like a mapped drive).
Heres is the script I used
Dim WinShell, prompt, folderpath, substcmd
Set WinShell = WScript.CreateObject("WScript.Shell")
prompt = "Type the path that you want to assign to drive w." & vbCrLf &_
"" & vbCrLf &_
"(Be sure to enclose the path in double quotes if it includes spaces.)"
folderpath = InputBox(prompt, "Where do you want to work today?")
If folderpath = "" Then
substcmd ="subst w: " & folderpath
WinShell.Run substcmd, 2, False
'MsgBox "Ready?", 32, "Make Work Drive"
'WinShell.Run "explorer.exe /n, /e, w:\",1,False
There is also a script to remove the work drive. I have tried to put this into VB put have been unable because VB doesn't like the WScript.CreateObject("WScript.Shell"). After searching on the web it turns out Wscript can only be used in scripting languages.
Is there a way of doing this in VB. The reasons for wanting to do this is, 1) People are reluctant to run VB scripts 2) Doesn't look very good and 3) I'd like to have an autorun on the CD which u can choose to create the work drive.
Thanks in advance