MSFN Forum: Setting %CDROM% VB Variable? - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Setting %CDROM% VB Variable? Rate Topic: -----

#1 User is offline   durex 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 953
  • Joined: 21-October 04

Posted 24 November 2004 - 03:19 AM

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!


#2 User is offline   jdoe 

  • Advanced Member
  • PipPipPip
  • Group: Banned
  • Posts: 314
  • Joined: 02-May 04

Posted 24 November 2004 - 04:47 AM

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


#3 User is offline   durex 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 953
  • Joined: 21-October 04

Posted 24 November 2004 - 11:08 AM

Excellent. Thanks a bunch jdoe.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy