Jump to content

Setting %CDROM% VB Variable?


Recommended Posts

What are you guys using in your VBScripts that are installing off of the cdrom? In the batch files im using the "FOR %%d IN...." command. Need something that looks for the WIN51 file in the root of the cdrom to use as an installation variable.

Thanks!

Link to comment
Share on other sites


Many ways to do that...

Set FSO = CreateObject("Scripting.FileSystemObject")
Set AllDrives = FSO.Drives

For Each Drive In AllDrives

   If Drive.DriveType = "4" Then

       If FSO.FileExists(Drive & "\WIN51") Then
           CDROM = Drive
           Exit For
       End If

   End If

Next

If Len(CDROM) = 0 Then WScript.Quit

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...