Jump to content

searching for CDROM


WotC

Recommended Posts

This would work at the stage and it check both the Hard drive CD or DVD Drive

Dim Act : Set Act = CreateObject("Wscript.Shell")
Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")
Dim Cnt, Drv, StrDrv
Set Drv = Fso.Drives
For Each StrDrv In Drv
If StrDrv.DriveType = 4 Or 2 Then
If StrDrv.IsReady = True Then
If Fso.FileExists(StrDrv & "\AllAppUA.cmd") Then
Cnt = 2
Act.Popup "Found The AllAppUa.cmd" & vbCrLf & StrDrv & "\AllAppUA.cmd" , 5, "Found", 0 + 32
Exit For
End If
End If
End If
Next

If Cnt < 1 Then
Act.Popup "Cannot Find The AllAppUa.cmd on the local" & vbCrLf &_
"Hard Drive or CD or DVD drive", 10, "Missing", 0 + 32
End If

Link to comment
Share on other sites


Quote GSM:

This one will check for a specific file on any CD or DVD drive, when the check file is found it will produce a message box that say This is a XP CD then it will quit the script.

Change this color in the script to suit your needs.

If Fso.FileExists(StrDrv.DriveLetter & ":\win51ip.SP2") Then

Dim Drv, Fso, StrDrv

Set Fso = CreateObject("Scripting.FileSystemObject")

Set Drv = Fso.Drives

For Each StrDrv In Drv

If StrDrv.DriveType = 4 Then

If StrDrv.IsReady = True Then

If Fso.FileExists(StrDrv.DriveLetter & ":\win51ip.SP2") Then

MsgBox "This is a XP CD : " & StrDrv.DriveLetter, 0 + 32,"Confirm XP CD"

Exit For

Else

MsgBox "This is not a XP CD : " & StrDrv.DriveLetter, 0 + 32,"Missing XP CD"

End If

End If

End If

Next

In a typical ua install off the cd/dvd where is this called from?

Cheers

MC.

Edited by MAVERICKS CHOICE
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...