Jump to content

Cd Path


Recommended Posts

is there a command that can use the cd rom name itself eg WINXP_SP1 then it would matter what drive letter it would be.

Create a vbs file and write in:

Set WshShell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Dim s
Call ChCD(D:\)
Call ChCD(E:\)
Call ChCD(F:\)
Call ChCD(G:\)
Call ChCD(H:\)
Call ChCD(I:\)
Call ChCD(J:\)
Call ChCD(K:\)
Call ChCD(L:\)
...
WshShell.MsgBox "CDROM Letter is " & s
...
Wscript.Quit
Function ChCD(DriveN)
Set d = fso.GetDrive(DriveN)
If d.IsReady And d.DriveType = 4 And d.VolumeName = "WINXP_SP1 " Then s = DriveN
End Function

This checks for

- drive ready?

- drive type CDROM

- Volume name

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...