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

wmic error (invalid XSL format) in windows7

wmic process get /format:csv What is wrong with this command in Windows 7? I get: Invalid XSL format (or) file name.
user1264880
  • 51
  • 1
  • 1
  • 3
4
votes
2 answers

Batch Script is exporting weird characters

I am having an issue with a script. I will post it. It runs fine till it gets to this line: wmic diskdrive list full | findstr /B "Size=" >> %cd%ProductCodes\%Serial%\PCINFO.txt This is what it sends to the file... 楓敺ㄽ㐲ㄱ㈱㤴㈹ര਍楓敺㈽㘵㔰㤲㘶〴ര਍ Any help…
doheth
  • 87
  • 9
4
votes
1 answer

WMIC lastmodified include in for loop

I am trying to get the lastmodified date of files which have almost the samename (CompactReg00 in common). I want this date to be safe to different date settings so I was thinking to use wmic command. The command work well if I use it like that…
Sirolf
  • 45
  • 4
4
votes
0 answers

Query antivirus product in Windows servers, where SecurityCenter2 namespace is not available

On workstations like Windows 7 I use the following command to query AV: WMIC /Node:localhost /Namespace:\\root\SecurityCenter2 Path AntiVirusProduct Get displayName /Format:List But on Windows Server 2012, the SecurityCenter2 namespace is not…
daisy
  • 22,498
  • 29
  • 129
  • 265
4
votes
0 answers

How to get raw disk access in python (windows) for disks > 2TB

I am trying to get raw disk access using python on windows to drives >2TB using python. Everything works great for disks under 2TB using wmi to find details about the disk size but for a 4TB drive it only sees the first 2TB. I assume it is because…
4
votes
3 answers

Script ignoring exit command and breaking out of function BATCH/CMD

This script I wrote is supposed to parse and pull the IP information out of WMIC. The issue is when it is used on a computer with only 1 DNS server entered, the script fails miserably. It appears to run the :remove function even if the variable DNS2…
Laser411
  • 43
  • 5
4
votes
3 answers

wmic useraccount SID blank spaces/empty lines

I have this two commands to get SID useraccount wmic useraccount where name='%username%' get sid | findstr /b /C:"S-1" > file.txt or for /F "tokens=2 delims=," %f in ('whoami /user /FO CSV /NH') do echo %~f > file.txt both cases (file.txt)…
BrianC
  • 149
  • 1
  • 2
  • 9
4
votes
2 answers

Powershell WMIC Datafile Invalid Query?

I have searched and searched, but cannot figure out why this is returning an Invalid query error: wmic datafile where name='c:\\program files (x86)\\Mozilla Firefox\\Firefox.exe' get version I've tried it with an elevated PS as well, thinking that…
PhoenixKsE
  • 153
  • 1
  • 6
4
votes
3 answers

save wmic useraccount where name to variable

How can I save the SID of the current user to variable? Based off of a similar question, the current code is as follows: @echo off for /f %%a in ('wmic useraccount where Name='%username%' get SID') do set "usersid=%%a" echo %usersid% exit /b Is…
7th Luke
  • 87
  • 1
  • 2
  • 9
4
votes
0 answers

regular win10 updates change SerialNumber

Our software generates a unique machine fingerprint which is used in our product's licensing. The machine fingerprint includes the SerialNumber obtained using WMI from Win32_OperatingSystem (e.g. wmic os get SerialNumber). Lately we have had a few…
4
votes
4 answers

Is it possible to send a file to a printer with a batch file?

How can I use a batch file to send a text file or a .doc or similar, to a printer plugged into the computer through a USB port?
4
votes
1 answer

Program still listed in Control Panel after uninstalling

I am trying to uninstall a program with a C# application and everything works except the program is still listed in the Control Panel Programs & Features. It also does this when I uninstall from the command line using wmic. The program is…
4
votes
1 answer

Text garble in batch script for wmic command

I'm trying to run the batch script to acquired the basic computer information like CPU,RAM and active Network card.Here is my code @Echo OFF set newline=^& echo. echo Manufacturer Information> test1.txt systeminfo|findstr /c:"Host Name" /c:"OS…
Deepak
  • 73
  • 2
  • 7
4
votes
1 answer

WMI giving me incomplete hardware info (PhysicalMemory)

I have read an almost exact same question regarding this issue already (WMI hardware, get RAM info), and here I'm hoping for more information on this topic. I need to get various hardware information such as RAM serial number, hard drive SN, CPU SN,…
Sophia
  • 155
  • 2
  • 13
4
votes
2 answers

Escaping strings when using wmic

I'm trying to sart an instance of VLC using wmic I'm doing this mainly because I want to capture the pid of the created process I know the command below works fine from the command line: C:\PROGRA~1\VideoLAN\VLC_117\vlc.exe rtsp://abcd…
user1447903
  • 303
  • 2
  • 7
  • 14
1 2
3
48 49