Find all machines where sound is installed and not installed

Hi,

I have a file with all the machine names.I want to find if sound is installed and machines which it is not installed.Any way i can find this out.
Machine name   Sound installed
Machine name  Sound not installed
Machine name Not able to connect.

Regards
Sharath
LVL 11
bsharathAsked:
Who is Participating?
 
Farhan KaziConnect With a Mentor Systems EngineerCommented:
:: ================
:: READ THIS FIRST
:: ================
:: * To run this script you must have domain administrators rights.
:: * This script require "Computers.txt" file on C: drive root from where it will pick computer names.
:: * Successful run will generate "SoundCardRpt.txt" on C: drive root.
:: * Copy and Paste following script into notepad and save it with any name having .bat extension.
:: Batch Script Start

@Echo Off
SETLOCAL EnableDelayedExpansion

IF NOT EXIST C:\Computers.txt Goto ShowErr
FOR %%R IN (C:\Computers.txt) Do IF %%~zR EQU 0 Goto ShowErr
IF EXIST C:\SoundCardRpt.txt DEL /F /Q C:\SoundCardRpt.txt

FOR /F %%c IN ('Type Computers.txt') Do (
    Echo Processing: %%c
      PING -n 1 -w 1000 %%c|Find /I "TTL" >NUL
      IF NOT ErrorLevel 1 (
            WMIC /NODE:"%%c" Path Win32_SoundDevice GET Status | Find /I "OK" >NUL
            IF NOT ErrorLevel 1 (
                  Echo %%c: SoundCard Installed >>C:\SoundCardRpt.txt) ELSE (
                  Echo %%c: SoundCard Not Installed >>C:\SoundCardRpt.txt)
      )ELSE (Echo %%c: Not able to connect >>C:\SoundCardRpt.txt)
)      

Goto EndScript
:ShowErr
Echo "C:\Computers.txt" file does not exist or file is empty!
:EndScript
ENDLOCAL
:: Batch Script End
0
 
bsharathAuthor Commented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.