Showing posts with label Command prompt. Show all posts
Showing posts with label Command prompt. Show all posts

2021-01-02

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

2020-01-22

Uninstall/repair pending update [Windows 10]

Open a command prompt and run the command:

dism /image:C:\ /Cleanup-Image /revertpendingactions

2020-01-06

Map network drive from command line

Open command line and enter:

net use y: \\ServerName\SharedFolder /persistent:yes

Use the /persistent switch to restore the connection at next logon

2019-08-14

Show / delete Wi-Fi profiles from command prompt

To show the network profiles type:

netsh wlan show profiles

To delete a specified network profile type:

netsh wlan delete profile name="profile name"

To delete al network profiles type:

netsh wlan delete profile name=*

2019-08-13

remove IMG_ from files / rename file from command prompt or PowerShell

Open command prompt and enter:

ren "img_*.jpg" "////*.jpg"

Open PowerShell and run:

get-childitem *.jpg | foreach { rename-item $_ $_.Name.Replace("IMG_", "") }

2018-07-27

List / add NTP servers from command line

List NTP servers:
  • w32tm /query /peers
Add NTP servers:
  • w32tm /config /update /manualpeerlist:"ntp.server1.edu ntp.server2.edu ..."

2018-05-30

Add user to local group / administrators group from command line

Open an elevated command line (it needs admin rights)

  • Add user to local group
    • net localgroup groupName userName /add
  • Add user to local administrators group
    • net localgroup administrators userName /add

2018-04-19

Stop Command line window to open new window when running a exe / command

Open a command line with elevated rights (run as admin) and run your command inside this window. It should not open an additional window

Synchronise computer clock with domain \ server clock

  • sync clock with the domain
    • NET TIME /DOMAIN /SET /Y
  • sync clock with a specified domain
    • NET TIME /DOMAIN:domainname /SET
  • sync clock with a specified time server from another domain
    • NET TIME /RTSDOMAIN:domainname /SET
  • sync clock with a specified server \ computer
    • NET TIME \\servername /SET /YES

2018-03-27

Open Control Panel item from the command line

CommandWinDescription
control access.cplXPAccessibility Options
control admintoolsAdministrative Tools
control appwiz.cplXP+Add/Remove Programs
control bthprops.cplVista+Bluetooth Devices
control collab.cplVista,7People Near Me
control console.cplConsole
control date/timeXP+Date/Time Properties
control desk.cplXPDisplay Properties
control desktop.cplXPDisplay Properties
control devapps.cplXPPCMCIA, SCSI adapters and tape drives
control findfast.cplFindFast
control firewall.cplXP+Windows Firewall
control flashplayercplapp.cpl8Flash Player Settings Manager
control foldersXP+Folder Options
control fontsFonts Folder
control hdwwiz.cpl7+Add Hardware
control inetcpl.cplXP+Internet Properties
control irprops.cplXP+Infrared
control infocardcpl.cplVista, 7Windows CardSpace
control internationalRegional Settings
control intl.cplRegional Settings
control joy.cplXP+Joystick Properties
control keyboardXP+Keyboard Properties
control main.cplVista+Mouse Properties
control main.cpl keyboardKeyboard Properties
control main.cpl powerPower Management [Win 95]
control mlcfg32.cplXP+Mail (Microsoft Exchange/Windows Messaging)
control mmsys.cplMultimedia Properties
control mmsys.cpl soundsSound Properties
control modem.cplModem Properties
control mouseXP+Mouse Properties
control ncpa.cplVista+Network Connections
control netconnectionsXP+Network Connections
control netcpl.cplNetwork Properties
control netsetup.cplNetwork Setup Wizard
control nwc.cplXPClient Service for NetWare
control odbccp32.cplXPODBC Data Source Administrator
control password.cplPassword Properties
control ports.cplPorts
control powercfg.cplXP+Power Management
control printersXP+Printers Folder
control rascpl.cplDial up monitor
control sapi.cplXPSpeech
control schedtasksXP+Scheduled Tasks
control srvmgr.cplServer, services and devices
control sticpl.cplScanners and Cameras
control sysdm.cplXP+System Properties
control tabletpc.cplVista+Pen and Input Devices
control telephon.cplXP+Phone and Modem Options
control timedate.cplVista+Date/Time Properties
control tweakui.cplTweakUI
control ups.cplUPS
control userpasswordsXPUser Accounts
control wuaucpl.cplXPAutomatic Updates
control wgpocpl.cplMicrosoft Mail Post Office
control wscui.cplXPAction Center