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
71
votes
4 answers

Determine Domain and username used to map a network drive

Using Windows 7 Enterprise with SP1, but I'm hoping to get a generic answer that would apply to Windows XP/2003/2008/Vista/7. From a command prompt, I execute a net use command to map the Z: drive to a share on another computer, but I don't use my…
Reg Domaratzki
  • 895
  • 2
  • 7
  • 11
38
votes
5 answers

How to view user privileges using windows cmd?

I am trying to view the user privileges using the command prompt in Windows. User account & User privileges such…
AJINKYA
  • 741
  • 2
  • 9
  • 20
37
votes
1 answer

What can I do about "WMIC is deprecated"?

I've been relying on these two commands: wmic memorychip get capacity // Outputs how much RAM there is (in a convoluted manner). wmic diskdrive get Status,Model // Checks whether the HDDs/SSDs on the system are (supposedly) still "OK" and…
user11773559
17
votes
3 answers

windows batch command to determine working directory of a process

Why I ask is that my program uses 3rd party software that sometimes leaves behind orphan processes that have no link back to my program or the 3rd party process. These orphan processes start to add up and consume tons of resources over time. I…
user972276
  • 2,973
  • 9
  • 33
  • 46
15
votes
4 answers

What "wmic bios get serialnumber" actually retrieves?

I wonder what sort of serialnumber wmic bios get serialnumber Windows commad actually gives you? Is it serial number of your motherboard? Documentation is not clear about it.
Vitaly P
  • 1,121
  • 3
  • 11
  • 21
13
votes
3 answers

Command to get Hard disk & processor spec remotely

What is the command(s) helps to get information of the Hard disk & processor in a remote windows machine ?
Aan
  • 12,247
  • 36
  • 89
  • 150
11
votes
1 answer

How to make wmic uninstall command take Y (yes) as a default input prompt

I'm using the uninstall command in wmic to uninstall a program. product where name=prg_name call uninstall When its executed it prompts the user to press 'Y/N'. I would like to automate it so that it takes 'Y' as default always. Could you please…
Sudhakar
  • 2,904
  • 8
  • 33
  • 47
11
votes
3 answers

How to use wmic job get/list in CMD to get process name and location?

I need to get the exact location of a process name that a scheduled job is executing. I want to use WMIC JOB (if you have any other suggestions.. let me know) to get that, but I don't know HOW exactly. I've tried several variations but no luck so…
user939034
11
votes
3 answers

Combine For /F with WMIC + WHERE clause + AND clause

How should this WMIC command be written when included in a FOR command in a script? wmic service where (name="themes" and state="running") get The code below does not work: For /F %%a in ( 'wmic service where ^("name='themes'" and…
ElektroStudios
  • 19,105
  • 33
  • 200
  • 417
9
votes
2 answers

How can I remove empty lines from wmic output?

This is my string to obtain the position of TeamViewer (any version) service executable: for /f "skip=1 delims=" %A in ('wmic path win32_service where "name like 'TeamViewer%'" get pathname') do set POSITION=%A The problem is caused by wmic because…
Giovanni
  • 93
  • 1
  • 1
  • 5
9
votes
3 answers

Trouble with powershell commas

Im trying to write a very brief powershell script that runs a few commands, pipes their output to a text file, and then does a search against a keyword. I cant figure out what to change however for this line: wmic service get name, startname |…
Jingles177
  • 499
  • 2
  • 7
  • 16
8
votes
7 answers

Why is the FOR /f loop in this batch script evaluating a blank line?

I'm trying to write a batch script that obtains (among other things) a list of all of the disk drives the computer has. The basic code looks something like this: REM Build the list of disk drives to monitor SETLOCAL enabledelayedexpansion FOR /f…
Morinar
  • 3,460
  • 8
  • 40
  • 58
8
votes
1 answer

WMIC command in batch outputting non UTF-8 text files

I'm using a WMIC command to output a list of SIDS and accompanying user profile names to text. From the text, I can edit a list of SIDS I need to add a set of registry keys to. However, the script that loops through the edited text file of SIDS is…
Tika9o9
  • 405
  • 4
  • 22
8
votes
1 answer

WMIC product where "name like..." - "no instances available" if run in batch file

I want to find what version of Outlook is running on specific workstations. If I manually run wmic /node:"hostname" product where "Name like '%Office Outlook%'" get Name in a command line, it works. But if I run it from a batch file, it returns…
user2132386
  • 95
  • 1
  • 1
  • 4
7
votes
3 answers

wmic diskdrive get serialnumber -> invalid xml output

I want to read the name and the serial number of my hard drives. I stumbled upon wmic but I'm having troubles. I guess these two commands should do the trick, but I only get the message: Invalid Xml-Content. //(Translated) wmic path…
user1210404
  • 73
  • 1
  • 1
  • 4
1
2 3
48 49