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
-1
votes
1 answer

Defined variable not outputting in batch script

For asset stocktake purposes, I'm trying to create a script in batch that runs through the machine names of computers which are in a local .txt file, getting the last person who logged into the machine, and outputting that to a text file with the…
-1
votes
1 answer

Getting the disk signature as negative

import wmi wmi_connector = wmi.WMI() def get_win_drive_mappings_locally(drivemappings): for physical_disk in wmi_connector.Win32_DiskDrive(): for partition in physical_disk.associators("Win32_DiskDriveToDiskPartition"): …
Vishnu Imp
  • 5
  • 1
  • 7
-1
votes
1 answer

What is the difference between properties "Caption", "DNSHostName" and "Name" in "wmic computersystem get /all"

So I'm trying to do a simple thing: rename the computer name using CMD (and/or batch). In CMD, when I type wmic computersystem get /all amongst other entries, I get Caption, DNSHostName and Name variables, all of those having the exact same value:…
0v3rl0rd
  • 47
  • 11
-1
votes
2 answers

How FileSystemObject count property handles the list of files return by the dir command

Function Run_Cmd(strCmd) Dim objShell Dim objScriptExec Dim strCmdResult strCmd = "%comspec% /C " + strCmd Set objShell = CreateObject("WScript.Shell") Set objScriptExec = objShell.exec(strCmd) set Run_Cmd =…
-1
votes
1 answer

How to find the nodes of a cluster from the command line

I would like to use wmic in my batch file to find the nodes of the cluster. I have found various references to the MSCluster_Node class, but I can't seem to get this working from the wmic command. I have tried the following command: wmic…
BeanFrog
  • 2,297
  • 12
  • 26
-1
votes
1 answer

CMD Help setting variable to second line of a txt

Let me preface, I've only been in software packaging a couple years and that has been the breadth of my cmd experience. This little bit is almost just an exercise for me so I can engage in a larger project soon after. I can't set an environmental…
mfrancke
  • 1
  • 3
-1
votes
1 answer

can't add double forward slashes on exec function php

Currently I have this problem in PHP, I am trying to make a simple webpage that executes some code in the shell and shows the proccess running the code I am trying to execute is this wmic -U User%Passwd //192.168.1.3 "select Caption from…
user8811
  • 13
  • 1
  • 6
-1
votes
1 answer

How do I find the DNS name of a physical Hyper-V server using remote WMIC commands? I only know the virtual servers' DNS names

I want to identify the underlying, physical Hyper-V server (e.g., hypervisor) by DNS name of a given guest OS. I log into various virtual servers regularly. I've read that there is a way with PowerShell (a command to find the hypervisor that…
-1
votes
1 answer

Error invoking command to install a Msi through Powershell

I am trying to use PowerShell's Invoke-Command but I am encountering an error that I have no idea of what it is! Would be great to have some help on this. I am sure that it must be something really simple.. invoke-command -scriptblock{ $executable…
FPTLS
  • 177
  • 3
  • 15
-1
votes
1 answer

Read the output from the wmic console application

Okay here's the issue i want to call the wmic.exe that is found in \windows\system32\wbem execute a command and only read the output from there. I don't want to use wmi using com as per msdn…
-1
votes
2 answers

Looking to Rename Computers with csv file and .vbs script

I would love to do this in Powershell but that isn't an option. I have a bunch of computers I'm looking to rename and am trying to automate the process as much as I can. I'd like to have a csv file setup with two columns (oldname,newname) and be…
-1
votes
1 answer

Setting User account "Full Name" and "Description" from within a batch using variables

I am attempting to write a batch script that adds new users to a machine using user prompts to get the information. I am at the point where the user gets created correctly, but the "Full Name" and "Description" fields don't populate, no matter what…
user3470424
  • 1
  • 1
  • 1
-1
votes
1 answer

Serial Number and Version for Windows OS on KVM

Does anyone know what will be output of : wmic get serialnumber, version on windows guestOS running on KVM? It would take too much time to install KVM just to get this info.
Jonhtra
  • 897
  • 2
  • 12
  • 18
-1
votes
1 answer

Process writing on wmic from java doesn't work on windows server 2008

Following works on my win8.1 but not on Windows Server 2008. If I close the outputstream then it works on windows server 2008 but that's not what I want. I want to keep open the wmic and process multiple commands. import…
Deepak Agarwal
  • 907
  • 6
  • 21
-1
votes
1 answer

Is there any way to to execute wmic from html or javascript

Im trying to figure out if we can execute a WMIC from html or javascript. wmic code : wmic /node:"server" /output:"C:test2.html" SERVICE where (state=”running”) get Name, Caption, State, ServiceType, StartMode, pathname /FORMAT:"htable.xsl" html…
Pravin
  • 1
  • 2
1 2 3
48
49