Datafile alias
C:> wmic datafile "c: \ hello.txt" call rename c: ppp.txt
Run (rename> \ QL-LIBOWENROOTCIMV2: CIM_DataFile.Name = "c: \ hello.txt")-> rename ()
The method is successfully executed.
Output parameters:
Instance of _ PARAMETERS
{
ReturnValue = 0;
};
C:> wmic datafile Where "drive = d: and extension = txt and path = \" get name
Name
D: abc.txt
D: Copy abc.txt
Wmic fsdir alias
Wmic fsdir where (name = c: \ good) delete
Wmic fsdir where (name = c: \ good) call delete
Delete the c: good folder
Wmic fsdir where (name = c: \ good) rename "c: abb"
Rename the c: good folder to abb
Copy a folder
C:> wmic fsdir where (name = d: \ test) call copy "c: ppcd"
Run (copy> \ QL-LIBOWENROOTCIMV2: Win32_Directory.Name = "d: \ test")-> copy ()
The method is successfully executed.
Output parameters:
Instance of _ PARAMETERS
{
ReturnValue = 0;
};
Copy all the files in the TEST folder on disk D to PPCD on disk C. If PPCD exists, copy it directly. If it does not exist, it will automatically create and copy the file.
C:> wmic fsdir where (name = d: \ test) call Compress
Run (Compress >\QL-LIBOWENROOTCIMV2: Win32_Directory.Name = "d: \ test")-> Compress ()
The method is successfully executed.
Output parameters:
Instance of _ PARAMETERS
{
ReturnValue = 0;
};
Compresses specified folders to save disk space
C:> wmic fsdir where (name = d: \ test) call unCompress
Run (unCompress> \ QL-LIBOWENROOTCIMV2: Win32_Directory.Name = "d: \ test")-> unCompress ()
The method is successfully executed.
Output parameters:
Instance of _ PARAMETERS
{
ReturnValue = 0;
};
Uncompress folders
Job alias
C:> wmic job call create "sol.exe", 154600.000000, 480, ********* +
Run (Win32_ScheduledJob)-> Create ()
The method is successfully executed.
Output parameters:
Instance of _ PARAMETERS
{
JobId = 1;
ReturnValue = 0;
};
This command is exactly the same as the AT command. He can see the scheduled task added by AT, and he can see the same AT command added by.
Wmic job call create "sol.exe", 154800.000000, true, false, ******** 480 +
Wmic job call create "sol.exe", 154600.000000, 480, ********* +
The two sentences are the same. TRUE can be expressed as 1, and FALSE can be expressed as 0. Why are eight asterisks used before the time? This is a feature of WMIC, the display time is YYYYMMDDHHMMSS. MMMMMM + time zone. However, we do not need to specify the year, month, and day. Therefore, use the * Asterisk instead.
OS alias
Wmic OS Where (primary = 1') call win32shutdown *
This * parameter can have the following values:
Const LOGOFF = 0
Const SHUTDOWN = 1
Const REBOOT = 2
Const FORCE = 4
Const POWEROFF = 8
These parameters can be combined as follows:
Force logout: 4 (0 + 4) Combination
Force Shutdown: Combination of 5 (1 + 4)
Force restart: 6 (2 + 4) Combination
Force power off: 12 (8 + 4) Combination
WMIC settings system time
Requires administrator privileges.
Wmic OS where (primary = 1) call setdatetime 20070731144642.555555 + 480
Run (\ QL-LIBOWENROOTCIMV2: Win32_OperatingSystem.Name = "Microsoft Windows XP P
Rofessional | C: \ WINDOWS | \ Device \ Harddisk0 \ Partition1 ")-> setdatetime ()
The method is successfully executed.
Output parameters:
Instance of _ PARAMETERS
{
ReturnValue = 0;
};
Process alias
C:> wmic process call create sol.exe
Run (Win32_Process)-> Create ()
The method is successfully executed.
Output parameters:
Instance of _ PARAMETERS
{
Processid= 3848;
ReturnValue = 0;
};
C:> wmic process 3848 call terminate
Run (terminate> \ QL-LIBOWENROOTCIMV2: Win32_Process.Handle = "3848")-> terminate ()
The method is successfully executed.
Output parameters:
Instance of _ PARAMETERS
{
ReturnValue = 0;
};
We can see that the PROCESS alias is operated based on the HANDLE attribute as the default attribute.
C:> wmic process 2556 call setpriority 64
Run (setpriority> \ QL-LIBOWENROOTCIMV2: Win32_Process.Handle = "2556")-> setpriority ()
The method is successfully executed.
Output parameters:
Instance of _ PARAMETERS
{
ReturnValue = 0;
};
Used to set priority of a program
64 Idle priority-low
16384 Below Normal priority-lower than standard
32 Normal priority-Standard
32768 Above Normal priority-higher than standard
128 High Priority-High
256 Real Time priority-Real-Time
Wmic process Where "processid = % pid %" call Terminate
Wmic process Where "name = % imagename %" call Terminate
Wmic path Win32_Process.name = "% imagename %" call Terminate
Wmic path Win32_Process.processid = "% pid %" call Terminate
Wmic process Where name‑sol.exe delete
Nicconfig alias
Wmic nicconfig where (index = 8') call enablestatic "192.168.1.81", "255.255.255.0 ″
Set IP address and subnet mask
Wmic nicconfig where (index = 8') call setgateways "192.168.0.1", 1
Set gateway and hops
Wmic nicconfig where (index = 8') call setdnsdomain ("192.168.0.1", "192.168.0.11 ″)
The DNS server address is set. It does not take effect immediately after it is set. You must set the primary and secondary nodes to take effect.
Wmic nicconfig where (index = 8') call SetDNSServerSearchOrder ("192.168.0.1", "192.168.0.11 ″)
Sets the Primary and Secondary order of the DNS server address. 192.168.0.1 indicates that it is the preferred DNS address, and later indicates the backup DNS address.
Wmic path Win32_NetworkAdapterConfiguration.index = 8 call enabledhcp
The default NICCONFIG alias of WMIC does not provide the enabledhcp method. Therefore, we can only call its WMI function to set the dynamic IP Address Allocation settings.
Wmic nicconfig where (index = 8') get/value INDEX value is the index value of your current Nic. Each machine is different.
The following are the network attribute values:
ArpAlwaysSourceRoute =
ArpUseEtherSNAP =
Caption = [00000008] Broadcom 440x10/100 Integrated Controller
DatabasePath = % SystemRoot % System32driversetc
DeadGWDetectEnabled =
DefaultIPGateway = {"192.168.0.1 ″}
DefaultTOS =
DefaultTTL =
Description = Broadcom 440x10/100 Integrated Controller-micro port of the data package Scheduler
DHCPEnabled = FALSE
DHCPLeaseExpires =
DHCPLeaseObtained =
DHCPServer =
DNSDomain = ("192.168.0.1", "192.168.0.11 ″)
DNSDomainSuffixSearchOrder =
DNSEnabledForWINSResolution = FALSE
DNSHostName = ql-libowen
DNSServerSearchOrder = {"192.168.0.1", "192.168.0.11 ″}
DomainDNSRegistrationEnabled = FALSE
ForwardBufferMemory =
FullDNSRegistrationEnabled = TRUE
GatewayCostMetric = {1}
IGMPLevel =
Index = 8
IPAddress = {"192.168.0.81 ″}
IPConnectionMetric = 20
IPEnabled = TRUE
IPFilterSecurityEnabled = FALSE
IPPortSecurityEnabled =
IPSecPermitIPProtocols = {"0 ″}
IPSecPermitTCPPorts = {"0 ″}
IPSecPermitUDPPorts = {"0 ″}
IPSubnet = {"255.255.255.0 ″}
IPUseZeroBroadcast =
IPXAddress =
IPXEnabled = FALSE
IPXFrameType =
IPXMediaType =
IPXNetworkNumber =
IPXVirtualNetNumber =
KeepAliveInterval =
KeepAliveTime =
MACAddress = 00: 0F: 1F: 4F: 08: A0
MTU =
NumForwardPackets =
PMTUBHDetectEnabled =
PMTUDiscoveryEnabled =
ServiceName = bcm4sbxp
SettingID = {B97AA60A-483E-4C84-84FE-5A3C6A875B65}
TcpipNetbiosOptions = 0
TcpMaxConnectRetransmissions =
TcpMaxDataRetransmissions =
TcpNumConnections =
TcpUseRFC1122UrgentPointer =
TcpWindowSize =
WINSEnableLMHostsLookup = TRUE
WINSHostLookupFile =
WINSPrimaryServer =
WINSScopeID =
WINSSecondaryServer =
WMIC registry operations
C:> wmic/namespace: \ rootdefault path stdregprov call getstringvalue ^ & H80000002, "SOFTWARElibowen", "hello"
Execute (stdregprov)-> getstringvalue ()
The method is successfully executed.
Output parameters:
Instance of _ PARAMETERS
{
ReturnValue = 0;
SValue = "I am Computer Pepole !!! ";
};
C:> wmic/namespace: \ rootdefault path stdregprov call createkey ^ & h80000001, "libowengood"
-- Create the libowengood key value
Execute (stdregprov)-> createkey ()
The method is successfully executed.
Output parameters:
Instance of _ PARAMETERS
{
ReturnValue = 0;
};
C:> wmic/namespace: \ rootdefault path stdregprov call deletekey ^ & h80000001, "libowensdd"
-Delete the key value SDD. Note that this key value must be at the bottom layer.
Execute (stdregprov)-> deletekey ()
The method is successfully executed.
Output parameters:
Instance of _ PA