Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WMI Script to sense PNP DVD install then install a program

Status
Not open for further replies.
May 8, 2002
16
US
Newbie to WMI but feel someone possibly has done something similar to this. Anyone know of anything?

Thanks!

Osceolakid
 
Check out the Microsoft tool "Scriptomatic" at
Run the .hta and use the Win32_PnPEntity and/or Win32_CDROMDrive query.

It should give you some insight

HtH,

Rob
robschultz@yahoo.com
-Focus on the solution to the problem, not the obstacles in the way.-
 
Hello RobSchultz and osceolakid,

I doubt win32_pnpentity and/or win32_cdromdrive can expose dvd drive. I may be wrong. Nevertheless win32_physicalmedia does implement mediatype property detecting dvd. But it is only implemented under winXP. Hence, if osceolakid has the winXP as working platform, it would be doing fine with wmi.
Code:
bDVD=false
set wmisvc=getobject("winmgmts:root\cimv2")
set cPMedia=wmisvc.execquery("select * from win32_physicalMedia")
for each oPMedia in cPMedia
    if (oPMedia.MediaType>=22) and (oPMedia.MediaType<=26) then
        bDVD=true : exit for
    end if
next
if bDVD then wscript.echo &quot;You have pnp dvd installed.&quot;
set cPMedia=nothing
regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top