2021-01-19

Add a network printer & Set a default printer in VBScript

Set WshNetwork = WScript.CreateObject("WScript.Network")
WSHNetwork.AddWindowsPrinterConnection "\\ServerName\PrinterName"
WSHNetwork.SetDefaultPrinter "\\ServerName\PrinterName"

Open Devices & Printers in VBScript

CreateObject("WScript.Shell").Run "control.exe /name Microsoft.DevicesAndPrinters"

2021-01-04

Disable ask for password after sleep

Windows 10:

Go to Settings > Accounts > Sign-in Options > Require sign-in and select Never

2021-01-02

Fix Windows time synchronization

Open command prompt and run:
w32tm /debug /disable
w32tm /unregister
w32tm /register
net start w32time

Windows Error Reporting folder location

The Windows Error Reporting folder location can be found here:

%LOCALAPPDATA%\Microsoft\Windows\WER

All files inside this folder can be deleted

fix GRUB missing in Windows/Linux dual-boot

Open a command prompt with elevated rights (run as admin) and run:

bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi

To restore to previous settings run:

bcdedit /deletevalue {bootmgr} path \EFI\ubuntu\grubx64.efi delete grub boot

bcdedit /set {bootmgr} path \EFI\Microsoft\Boot\bootmgfw.efi set windows boot

List installed printers from command line / PowerShell

Open a command prompt and run:

wmic printer list brief

Open PowerShell and run:

Get-Printer | Format-List list printers with details

Get-Printer | Format-List Name list printers names

Change IP / DNS / Gateway from command prompt

To change the IP:

netsh int ip set address "local area connection" static 192.168.0.1

To change the DNS:

netsh int ip set dns "local area connection" static 192.168.0.255 primary