Questions tagged [wmic]
173 questions
164
votes
16 answers
How can I find out when Windows was last restarted?
How can I know when my computer running Windows 7 was last restarted?
I prefer a solution that doesn't involve searching the event log, but something like wmic or maybe cmd commands.
Royi Namir
- 5,888
20
votes
6 answers
'wmic' is not recognized as an internal or external command, operable program or batch file
I need to run this script I made. This batch should copy compiled program on STM32 Nucleo. It uses wmic to find Nucleo's virtual drive's letter by it's label:
@echo off
for /f %%D in ('wmic volume get DriveLetter^, Label ^| find "NODE_F446RE"') do…
Tomáš Zato
- 4,790
17
votes
1 answer
How to find out how long a process has been running for?
Is it possible to use wmic or powershell to find out how long a process has been running for?
If not, is there any other mean to obtain this information from Windows OS?
Anthony Kong
- 5,318
9
votes
4 answers
Combine Batch/WMIC + ANSI/UNICODE Output formatting
In creating an auditing tool for my network, I'm finding that WMIC is outputting with spaces in between each character when accompanied by echoing regular text. For example,
This:
@echo off
echo Foo >> "C:\test.txt"
wmic CPU Get AddressWidth >>…
root
- 3,920
8
votes
2 answers
How to get BIOS serialnumber with WMIC command
Whenever I use the command line below
wmic bios get serialnumber
It outputs the BIOS Serial number with my laptop.
However, I've tried that command line to get BIOS serial number with my company's PC, I didn't work a bit.
Here was the…
PMay 1903
- 183
8
votes
2 answers
Run WMIC command across network
Instead of typing this in a command prompt one at a time:
wmic /node:ipaddress /user:administrator /password:mypassword bios get serialnumber
How can I run that against one entire subnet and output to a text document? Since I do this every couple…
C-dizzle
- 1,946
8
votes
3 answers
WMIC Path ? WMIC Class ?
There are all sorts of commands that WMIC accepts, such as
WMIC Path Win32_Battery
WMIC Path Win32_Processor
WMIC Class Win32_Battery
WMIC Class ComputerSystem
et cetera.
Is there any way to list all of these potential "path"s and "class"es, etc.…
user541686
- 23,629
8
votes
7 answers
WMIC output property value without property name
I'm entering something like that
Desktop>wmic environment where(name="PATH" and systemVariable=FALSE) get variableValue
VariableValue
xxx
But I don't want VariableValue to get into output. I want simply get xxx
Is it possible?
Paweł Audionysos
- 249
8
votes
1 answer
"No Instance(s) Available" error with the wmic command
I'm getting a "No Instance(s) Available" error with the wmic command. The command I'm running (from an elevated/administrator cmd.exe window) is:
G:\>wmic datafile where name="file.txt" get creationdate
No Instance(s) Available
The file "file.txt"…
Kevin Fegan
- 4,997
7
votes
2 answers
What are the differences between "Windows wmic" and "Windows registry"?
Is all the information that is available via Windows Management Instrumentation Command-line(wmic) also available via Windows registry(regedit)?
What are the main differences between them?
Diogo
- 30,792
7
votes
1 answer
How to detect/identify M.2 SSD
As you know you can get a list of drives connected via SATA using wmic:
wmic diskdrive list
This however doesn't seem to work with M.2 SSDs. Is there any equivalent for M.2 SSDs that is not vendor specific?
marekp
- 179
6
votes
1 answer
Is there an efficient way to query if product is installed on Windows and retrieve IdentifyingNumber
I'm trying to automate a test process to first uninstall a product if present.
To find the product I've so far found that the information is available through wmi and wmic product get IdentifyingNumber, name, version | findstr /I /C:"Name" retrieves…
Greg Domjan
- 163
5
votes
1 answer
how to completely disable pagefile use wmic
Hi I am trying to create a batch file to disable the page file on windows 7, is there any wmic command will do this? I know I should be able to use
"wmic pagefileset delete"
however this always give me the error no instance(s) available, any…
John
- 51
5
votes
3 answers
How can I run a single command to show all installed applications in Windows 10?
To follow-up and expand upon this question, I want to know how to get a list of applications as shown in appwiz.cpl which always shows all installed applications.
From here, we know that other installers like InstallShield, Wise, NSIS do not…
bluesquare
- 487
5
votes
3 answers
How to properly filter a wmic diskdrive list
I'm trying to filter results of a wmic list with where-object but unfortunately this does not seems to work.
wmic diskdrive list brief | Where-Object -Property "Caption" -Contains "Samsung"
The filtered result is empty, the unfiltered result is as…
Soleil
- 428