Skip to main content

Posts

Showing posts with the label WMIC

WMIC restart wireless network via command line in Windows

How to restart WiFi or Wireless using command line in Windows? If the wireless devices, laptops or computers are connected to a domain such as active directory, or a centralized control. The command below can be created using a batch file and deploy to all controlled devices or computers. The command below, has been tested on a Windows 11 laptop and works fine. If nothing goes wrong, the command executes very fast. Here's the command, must be executed on an elevated command prompt or administrator prompt. wmic service where caption="WLAN AutoConfig" call stopservice && timeout 3 && wmic service where caption="WLAN AutoConfig" call startservice Timeout command is used in between stop and start, as this would give the first command to stop the service and after 3 seconds, another command is executed to start the service. Without the timeout command, the second command might not run  properly, since the first is still executed on the background. Jus...

Windows CLI get CPU Name, IP, OS, Mem and computer Name

One of the task of a Windows Admin is to know what OSes are running on his or her environment. Aside from checking what type of OSes are running, making sure also that CPU and Memory on users computers are suitable enough, so users can be productive. If the user doesn't have enough resources to run any software to do users tasks won't be  productive at all since and may end up consuming a lot of coffee than doing their work. :) So, as an IT Admin checking all these things will help to have a smooth operations. IP Address is the communication link of the device to the router, and the IP Address also links to the hostname or computer name and will be ultimately linked also to the logged in user. Example, deploying a specific software to a single user. IP Address must be known  in advanced or else the software being deployed might end up in someone else computer and can be disastrous if the license will be tied automatically to the hostname or IP Address.  WMIC command below...

Check Windows version Home or Pro via command line

How to check Windows if it is a Home or Pro version? WMIC a command line tool that is able to check the Windows version, build number and also shows whether the OS is a Pro or Home version. In an AD environment having a Home version of Windows is not a good idea as the OS isn't able to join a domain. Here's the WMIC command line to check. Open the command line window by pressing windows key + r, and type: cmd then press enter A new window will appear and type this command line: wmic os get BuildNumber, Version, Caption  After typing the command line and pressing enter  key, it will show a similar output like the image below: It will display, BuildNumber, Caption which will show whether the OS is home or pro, and the Version of the OS. That's it, WMIC is a great tool. Cheers. Till next time. Stay safe! and keep things up! ================================ Free Android Apps: Click  links below to find out more: Excel Keyboard guide: https://play.google.com/store/apps/details...

Monitor disk drive space using PowerShell

Monitoring space is quite crucial in a critical system, or basically checking the disk space whether there is enough free space for continual operation is a good thing to consider in a production environment. A simple PowerShell script can save the day by monitoring the drive space of a specific drive that needs to be checked or monitored. It doesn’t need a complex tool to do this kind of task. Here’s a one-liner PowerShell script to check free space on C drive. Get-WmiObject Win32_LogicalDisk -filter "DeviceID = 'c:' " | Select-Object   { $_ . FreeSpace / 1GB }   "DeviceID = 'c:' " = this can be changed to any drive letter Output of the above command: $_.FreeSpace /1GB -----------------   293.042289733887   Or to include the existing size of the drive, the command can be tweaked like this: Get-WmiObject Win32_LogicalDisk -filter "DeviceID = 'c:' " | Select-Object   { $_ . FreeSpace / 1GB } , { $...

WMIC command get CPU Load Percentage

Getting CPU load percentage is quite helpful in determining whether the server or computer is on a heavy performance, this would also indicate whether there is a need to increase the memory or add another CPU to the machine. Of course, when the CPU has a lot of load, performance will be impacted directly. Which basically means that the machine will not be working perfectly. Checking the CPU load will also help to troubleshoot, if the services on the machine or server is experiencing slow performance. Here’s the wmic command line which check the CPU Load Percentage. wmic cpu list status Sample output: Availability   CpuStatus   CurrentVoltage   DeviceID   ErrorCleared   3                              1                      9     ...

How to insert landscape orientation in Word?

How to insert a different section or page in a Word document? How to mix portrait and landscape in a Word office 365? If you are writing a thesis, a report or an article that you need to insert a landscape layout in a specific page in Word document but your orientation all long is portrait and changing the orientation causes the whole layout to change. Inserting landscape in a specific page in a word document can be done by inserting section breaks. Let’s just make a basic example. Let’s say you have 3 page document and you want that first page in Portrait mode, second page in landscape and third page in portrait layout also. First, click on “home” tab, click the “show/hide paragraph marks” option or see the icon below. Enabling this option the section breaks, spaces and tabs will be visible. But what we are interested is to see the “section breaks”. In the first page position the cursor on the last area at the bottom of the page. In Word 2010, cli...

Copy a single file using robocopy

Copy a single file using robocopy from a local folder to a shared folder on the network. A simple rule of thumb before any disaster strike, don't interchange the source and the destination. If source and destination is mistakenly reverse, files might get overwritten. To avoid any loss of data do a test with a dummy file to ensure things work perfectly. Robocopy [source]    [destination]   [file to be copied] robocopy c:\local_c_folder  \\PC_network\shared_folder   file_to_be_copied_xx.txt The command will be completed successfully provided the network access right has no issues. Robocopy works quite good on large files. A simple copy or xcopy command will also work but the speed might vary. However, if the file (ex. an ISO file) and is more than 4GB and the filesystem  of the thumbdrive or the storage is FAT system, then robocopy or any methods of copying will not work. Since FAT has a file size limitation of less than 3GB. Roboco...

PowerShell list printers of remote computers

How to print installed printers on remote computers? With and PowerShell WMIC it can be don easily. PowerShell command to list installed printers of a remote PC. Invoke-command -ComputerName PC0100 -ScriptBlock { wmic printer get name} Command above needs appropriate privileges to execute successfully and remote computers should be configured to accept remote WMI   commands. Sample output:                     Send To OneNote 2010                     Microsoft XPS Document Writer            Microsoft Office Document Image Writer       To list the printers via command line:  http://quickbytesstuff.blogspot.sg/2014/11/wmic-list-printers.html  Cheers..hope it helps.. ========...

WMIC Get IP Address

How to get IP Address via command line using WMIC? Get IP Address of   remote computer. Get IP Address using WMIC.       wmic nicconfig get IPAddress,ServiceName Sample output: IPAddress                                       ServiceName                                                 kdnic {"169.254.0.241", "fe80::26d0:eff6:cc27:e1"}    VBoxNetAdp {"192.168.11.6", "fe80::8798:acfe:6ee9:8b7c"}    athr                                                 L1C                                             ...

Command line query service status

How to query windows service status using command line? Sc.exe a command line tool for Windows operating system that every Windows admin should know. The Sys Admin is able to query, list, start or stop Windows services using this tool. Sc.exe command line tool will help to query service status on local computer, remote computers or servers. Example below shows the command line to query or list the services state that are running. Query running services: sc query | findstr /c:" RUNNING"  /c:"SERVICE_NAME" Sample output: SERVICE_NAME: AdobeARMservice         STATE              : 4  RUNNING SERVICE_NAME: AntiVirSchedulerService         STATE              : 4  RUNNING SERVICE_NAME: AntiVirService         STATE...

Enable ICMP or Ping request on Windows

If you ping a remote computer but fails, it could be that the firewall does not allow ICMP protocol. Enabling ICMP or ping requests is quite useful for troubleshooting purposes but it could be also a security issue. To enable ping or ICMP in Windows Firewall with Advance security, can be done via command line or using the graphical interface. Command line is quite useful if the setting has to be done repeatedly or it has to be done on multiple machines. Command line will also be helpful if a setting has to be enabled or disabled at times. Graphical interface is of course the easiest method if it has to be done one time but if the setting has to be done a couple of times then command line or scripting is definitely a good choice unless the person loves to click and click. Enable Ping response using command line: netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=allow Disable Ping respo...