Questions tagged [wmic]

WMIC stands for Windows Management Instrumentation Command-line

WMIC stands for Windows Management Instrumentation Command-line. It uses the power of Windows Management Instrumentation (WMI) to enable systems management from the command line. WMIC extends WMI for operation from several command-line interfaces and through batch scripts. WMIC gives you a powerful, user-friendly interface to the WMI namespace.

More information

734 questions
7
votes
5 answers

Find the version of a installed program from batch file

We have a batch file that installs several programs as part of the developers setup. This is ran periodically when we get new versions of used components. So it would be nice only to install if the versions are different. At the command prompt I can…
graham.reeds
  • 16,230
  • 17
  • 74
  • 137
7
votes
1 answer

WMIC: how to use **process call create** with a specific working directory?

The task is to launch a program using wmic process call create "c:\folder\app.exe" and have app.exe access it's own support files in the app.exe home folder tree. The batch script below illustrates the problem with WMIC silently changing the working…
foxidrive
  • 40,353
  • 10
  • 53
  • 68
6
votes
3 answers

WMIC Returning Odd Serial Number

I have an odd issue. I'm attempting to return the hard drive serial number from WMIC to a variable in a batch file; the line that gives me the variable is: for /f "skip=2 tokens=2 delims=," %%a in ('wmic diskdrive get serialnumber /FORMAT:CSV') do…
ITGuyLevi
  • 88
  • 1
  • 5
6
votes
2 answers

How to find a process pid with wmic and kill it with taskkill

I need to find a process PID with WMIC command, and then kill this process with taskkill. I've almost achieved that, but the only problem is there is a newline on the end of the PID variable. So far i made this: c:\patryk>for /F "skip=1 tokens=*" %a…
Patryk S
  • 63
  • 1
  • 1
  • 5
6
votes
3 answers

How to correct variable overwriting misbehavior when parsing output?

I am checking for baseboard information in a batch file with the following code. BaseboardCheck.cmd: @echo off setlocal EnableDelayedExpansion for /f "tokens=1,2* delims==" %%a in ('wmic baseboard get /format:list') do ( if ["%%a"] EQU…
Thumper
  • 525
  • 1
  • 6
  • 21
6
votes
1 answer

Powershell get-item VersionInfo.ProductVersion incorrect / different than WMI

I'm trying to understand why Powershell would get back a different version number for a DLL file than what both the file properties page from Windows Explorer, and a WMI query shows. (I apologize in advance if this doesn't correctly qualify as a…
jschleicher
  • 63
  • 1
  • 1
  • 3
5
votes
1 answer

How to find which network profile(s) are active via cmd or batch script

In the windows registry here: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles\ we can see a list of network IDs with Network name like usually the word Network plus a number eg Network 1 for wired networks. When Windows first…
Nolanr
  • 61
  • 1
  • 4
5
votes
3 answers

Not able to start kafka with .\bin\windows\kafka-server-start.bat .\config\server.properties cmd

I have preconfigured zookeeper and kafka using the following link used follow link : https://dzone.com/articles/running-apache-kafka-on-windows-os After making all the changes, I execute this command in cmd prompt…
Anoop
  • 71
  • 1
  • 1
  • 6
5
votes
1 answer

Get maximum supported resolution of all attached monitors

I'm trying to get the maximum supported resolution of both of my monitors using WMI (since it will be part of a VBScript)I've tried the following WMI commands, but I either get a wrong result or only get info for one monitor. C:\>wmic path…
Tim
  • 2,701
  • 3
  • 26
  • 47
5
votes
2 answers

When and what to escape within FOR /F and WMIC in a batch file

I have the following code that is supposed to return the last modified date of a file as a string: :getLastModifiedDate @echo on SETLOCAL enabledelayedexpansion set FILE=%~f1 set FILE=!FILE:%NETWORK_DRIVE_SHARE_PATH%=%NETWORK_DRIVE_NAME%! set…
KoenigGunther
  • 130
  • 1
  • 8
5
votes
3 answers

Get Interface name, IP and MAC in Windows Command line

I want to get a list of all the interfaces, IP and MAC address on a machine. I have quite a few machines to get this information from (around 600) and I can't use a batch file on the devices. I would like to send the command and get back an echoed…
scott
  • 143
  • 1
  • 2
  • 12
5
votes
1 answer

How to run wmic command in a batch file

I am running couple of wmic commands in a btach file to find a process and killing it. wmic Path win32_process Where "CommandLine Like '%app1%'" Call Terminate wmic Path win32_process Where "CommandLine Like '%app2%'" Call Terminate These commands…
Bankelaal
  • 408
  • 1
  • 9
  • 24
5
votes
2 answers

Use WMIC to query local administrator group members

Does anyone know of a way to query members of the local admin group using WMIC (On a remote server)? I'm aware that this is possible through powershell and vbs, but I'm really looking for a command line only option (to be called from an internal PHP…
erstbe
  • 83
  • 1
  • 1
  • 7
5
votes
2 answers

wmic cpu get LoadPercentage always returns empty value

I'm use wmic command to get current CPU utilization, the command are: wmic cpu get LoadPercentage /value It's works fine at first, but somehow it doesn't shows the LoadPercentage, but always returns with empty result…
leeyiw
  • 414
  • 2
  • 6
  • 14
4
votes
1 answer

wmic temperature

How can I get temperature (for example CPU) of my 32bit windows 7 PC? (by using WMIC) my results: wmic temperature No Instance(s) Available. I run this command even with admin privileges, but the result was the same.
wiki
  • 1,877
  • 2
  • 31
  • 47
1
2
3
48 49