Solved

needing wmic csproduct get name script for bios updates, etc

Posted on 2010-09-09
2
875 Views
Last Modified: 2012-05-10
I'm needing some sort of script that I can run against 3 models of computers, and say "if wmic csproduct get name = 755 optiplex, run this......., and this. If wmic csproduct name = optiplex 620 run this, and this.
Basically just having to update bios and its settings, plug some power management settings on the NIC. I'm not the greatest scripter, but know what I'm needing. Any help is appreciated!
0
Comment
Question by:khptech
2 Comments
 
LVL 39

Expert Comment

by:Krzysztof Pytko
ID: 33636455
OK, try this, open notepad put it there and asave as bat or cmd

@echo off

wmic csproduct get name >#

findstr /i "755 optiplex" "#"

if %errorlevel%==1 goto install1

findstr /i "optiplex 620" "#"

if %errorlevel%==1 goto install2

:install1

run_file1.exe
goto end_script

:install2

run_file2.exe
goto end_script

:end_script
0
 
LVL 51

Accepted Solution

by:
Bill Prew earned 500 total points
ID: 33636722
Here's how I would approach it in a BAT file.

~bp
@echo off
for /F "skip=2 tokens=2 delims=," %%A in ('wmic csproduct get name^,version /format:csv') do (
  if /I "%%A" EQU "755 optiplex" (
    REM insert processing needed here
    exit /b
  )
  if /I "%%A" EQU "optiplex 620" (
    REM insert processing needed here
    exit /b
  )
)

Open in new window

0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now