Questions tagged [wmic]
162 questions
150
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,598
- 14
- 47
- 70
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
- 4,868
- 11
- 48
- 80
10
votes
4 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,282
- 14
- 48
- 77
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,672
- 7
- 27
- 45
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,926
- 7
- 21
- 38
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,777
- 3
- 24
- 37
7
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,663
- 46
- 140
- 214
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,192
- 65
- 150
- 222
7
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
- 229
- 2
- 4
- 8
6
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
- 163
- 1
- 1
- 3
6
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
- 169
- 2
- 2
- 9
5
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
- 153
- 1
- 1
- 4
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
- 344
- 3
- 16
5
votes
2 answers
Has WMIC been un-deprecated?
For a long time, I've been putting off changing all my WMIC-based commands into "whatever modern junk Microsoft wants me to use now", having spent significant time trying (and failing) to find alternatives.
To stress me further, it kept showing…
Couper
- 51
- 1
- 2
4
votes
1 answer
Command "wmic memphysical get maxcapacity" gives wrong number
I have been using my laptop with 16G (8gx2) memory for a long time, I can use all of 16G memory without any problem, but ran wmic memphysical get maxcapacity today shows however 8388608 (8G), apparently wrong, what's wrong with the command? More…
Edward
- 193
- 1
- 2
- 10