CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2004
    Posts
    6

    How do i play a wav file from vbscript?

    I have my vbscript working...now I just need it to play a wav file.

    How do I do that? I have search and searched. Instead of "A Job is printing" I want it to play a .wav file. Please help. thanks.

    Here is my script:

    WARNING_THRESHOLD=0
    Const PAUSETIME = 500
    For i = 1 to 120000
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    Set colPrintQueues = objWMIService.ExecQuery _
    ("Select * from Win32_PerfFormattedData_Spooler_PrintQueue Where Name <> '_Total'")
    For Each objPrintQueue in colPrintQueues
    If objPrintQueue.Jobs > WARNING_THRESHOLD Then
    Wscript.Echo objPrintQueue.Name & "A Job is Printing!"
    End If
    NEXT
    Wscript.Sleep PAUSETIME
    Next

  2. #2
    Join Date
    Jun 2004
    Posts
    142
    try here

    http://www.mindspring.com/~majik/howto/howtosound2.htm

    sorry on a second look I don't think this is what your looking for. But you can take a quick visit just in case
    (last example on the page)
    Last edited by bobo; June 11th, 2004 at 09:03 PM.

  3. #3
    Join Date
    Jun 2004
    Posts
    6
    I figured it out thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured