[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Find all machines where sound is installed and not installed

Posted on 2007-08-11
2
Medium Priority
?
203 Views
Last Modified: 2010-03-05
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
0
Comment
Question by:bsharath
2 Comments
 
LVL 26

Accepted Solution

by:
Farhan Kazi earned 2000 total points
ID: 19676025
:: ================
:: 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
 
LVL 11

Author Comment

by:bsharath
ID: 19676645
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome to my series of short tips on migrations. Whilst based on Microsoft migrations the same principles can be applied to any type of migration. My first tip is around source server preparation. No migration is an easy migration, there is a…
Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question