Windows run command parameters

Содержание
  1. 25 Run Commands in Windows You Should Memorize
  2. How to open the Run dialog?
  3. #1. Access System Configuration — “msconfig”
  4. #2. Access Resource Monitor — “resmon”
  5. #3. Open System Information — “msinfo32”
  6. #4. Access Backup and Restore window — “sdclt”
  7. #5. Access mouse properties — “main.cpl”
  8. #6. Open Windows Registry — “regedit”
  9. #7. Access System Properties — “sysdm.cpl”
  10. #8. Manage Windows Power options — “powercfg.cpl”
  11. #9. Open Windows Features — “optionalfeatures”
  12. #10. Open Magnifier — “magnify”
  13. #11. Open Character Map app — “charmap”
  14. #12. Access Network Connections — “ncpa.cpl”
  15. #13. Run Malicious Software Removal Tool — “mrt”
  16. #14. Open Device Manager — “devmgmt.msc”
  17. #15. Manage User Accounts — “netplwiz”
  18. #16. Open Services app — “services.msc”
  19. #17. Access Programs and Features window — “appwiz.cpl”
  20. #18. Open Control Panel — “control”
  21. #19. Open current user folder — “.” (period)
  22. #20. Open On-Screen Keyboard — “osk”
  23. #21. Open Snipping Tool — “snippingtool”
  24. #22. Open Windows Memory Diagnostic — “mdsched”
  25. #23. Open any website — “Insert website URL”
  26. #24. Open Remote Desktop Connection — “mstsc”
  27. #25. Open Command Prompt — “cmd”
  28. Wrapping up
  29. Windows commands
  30. Prerequisites
  31. Command shell overview
  32. Command-line reference A-Z
  33. Using command line arguments for Windows Terminal
  34. Command line syntax
  35. Options and commands
  36. Command line argument examples
  37. Target a specific window
  38. Open a new profile instance
  39. Target a directory
  40. Multiple tabs
  41. Multiple panes
  42. Multiple tabs and panes
  43. Tab title
  44. Using application title (Preview)
  45. Tab color
  46. Color scheme (Preview)
  47. Tab focus
  48. Examples of multiple commands from PowerShell
  49. Single quoted parameters
  50. Escaped quotes
  51. Using start

25 Run Commands in Windows You Should Memorize

Using Run commands in Windows is a very efficient way to access different Windows settings and apps directly.

If you memorize Run commands, you can access a particular app in just 2 steps instead of many clicks.

I personally don’t like frequently reaching out for the mouse; therefore, I have memorized all the required keyboard shortcuts and commands to minimize my interaction with the mouse. And Run commands are core for my day-to-day PC usage to accesses different Windows settings and apps efficiently.

If you are looking to be productive, then I will recommend you to memorize Run commands. To get you started, I will list some of the frequently used commands that I find most useful for day-to-day use.

How to open the Run dialog?

To use Run commands, you need to know how to open the Run dialog to enter the commands. There are two ways to access the Run dialog in Windows 10.

You can either press the Windows+R keys on the keyboard or right-click on the start menu and select Run from the menu.

I will recommend you to use the keyboard shortcut as it’s much faster and you won’t have to use the mouse. Once the Run dialog is open, enter any of the below mentioned commands and press the Enter key or click on the OK button to execute it.

#1. Access System Configuration — “msconfig”

Starting with my favorite command, the System Configuration window consists of multiple tabs to manage boot settings and background services.

If you have a dual boot setup or often need to access safe mode, you will often need to access these settings. Don’t forget to check its Tools section for convenient access to some of the most powerful Windows tools.

#2. Access Resource Monitor — “resmon”

A very powerful app to see real-time information about your system resources like CPU, RAM, disk, and network. For any computer hanging or performance-related issues, this is the best tool to get the information you need.

#3. Open System Information — “msinfo32”

System Information app offers extensive information about both the hardware and software of your PC. It’s a must-know command if you need to see the specs of any PC. The information is well laid out using dedicated categories, and you can export the information to a file to share with anyone — perfect for getting online tech assistance.

#4. Access Backup and Restore window — “sdclt”

It opens the backup and restores window where you can either set up a backup of your PC or restore it from an old backup if there is a problem with your PC.

#5. Access mouse properties — “main.cpl”

You can control all the settings related to your computer mouse here. This includes mouse speed, buttons, wheel, and pointer, etc.

#6. Open Windows Registry — “regedit”

If you ever need to access the Windows registry to tweak something, this is the easiest way to do it. I didn’t even know other ways to access the Registry until recently, and I often mess around in the Registry. Other ways are simply too cumbersome to use.

#7. Access System Properties — “sysdm.cpl”

Another powerful settings window to manage system protection and remote connection features. I personally access it often to manage the Performance settings under the Advanced tab. You can manage some interesting performance-boosting options there.

#8. Manage Windows Power options — “powercfg.cpl”

You will find all the options to manage your PC’s power options here. There are a plethora of options to both save power or get better performance. Check this guide to optimize the power options as you find best.

#9. Open Windows Features — “optionalfeatures”

Here you can disable/enable some of the most advanced features of Windows. I wouldn’t recommend you to mess around here if you don’t know what you are doing. You will need to use this window if you ever need to enable features like Telnet client or Hyper-V.

#10. Open Magnifier — “magnify”

This opens the Windows magnifier to magnify the content on the screen up to 1600% if needed. It also has a screen reader built-in to read aloud text on the screen.

#11. Open Character Map app — “charmap”

Windows Character Maps lets you access All the characters in the font of your choice to easily use anywhere you like. You can either copy the character or learn its Alt code to enter anywhere you like. Using the search bar is the easiest way to find the character you need.

#12. Access Network Connections — “ncpa.cpl”

Here you can manage your current network connection and fix any problem with the network device. You can enable/disable the network, check the current status, bridge connections, or see your Wi-Fi password.

Читайте также:  Ограничение размера логов linux

#13. Run Malicious Software Removal Tool — “mrt”

It’s an on-demand virus removal tool provided by Microsoft to scan your PC and find any malicious software. If you think your PC got infected by a virus, you can quickly launch this tool to scan your PC.

You can also consider installing antivirus software to keep your Windows computer safe.

#14. Open Device Manager — “devmgmt.msc”

Device Manager is the go-to place to manage everything related to your hardware components and their drivers. You can enable/disable hardware components or manage their drivers, like uninstalling or updating them.

#15. Manage User Accounts — “netplwiz”

You can quickly manage user accounts here, such as adding a new account or user account types like Administrator or Standard. You can also change the user accounts password here and manage their security.

#16. Open Services app — “services.msc”

This app lists all the services that work in the background without an interface and make all the features work in Windows. Again, you shouldn’t mess with any services if you don’t know what you are doing. However, you can click on a service to learn what it does in the left panel. There are many services that you can enable/disable depending on your need. For example, I have disabled the Bluetooth service as I don’t use it.

#17. Access Programs and Features window — “appwiz.cpl”

Although Windows 10 has its own setting to uninstall an app, I still use this command as it only shows third-party apps. The default Windows uninstaller shows all apps, including built-in apps, which are 30+. It can be difficult to always go through so many apps to uninstall a recently installed app. This command makes the process a snap.

#18. Open Control Panel — “control”

This command didn’t hold much value in the older version of Windows as you could easily access Control Panel using different ways. However, in Windows 10, Microsoft promotes the new Settings over the old Control Panel, so it doesn’t offer an easy way to access the Control Panel. This simple command lets you easily access it.

#19. Open current user folder — “.” (period)

We have to access the user folder quite often in Windows, but going through the explorer to access it isn’t needed. Just type a period in the Run dialog, and the current user’s folder will open up.

#20. Open On-Screen Keyboard — “osk”

If you want to use the on-screen keyboard, then using the Run command is one of the quickest ways to do it.

#21. Open Snipping Tool — “snippingtool”

Snipping Tool is still the go-to tool for taking screenshots in Windows 10 without using a third-party app. If you use the Snipping Tool for taking screenshots, then this Run command will make it easier.

#22. Open Windows Memory Diagnostic — “mdsched”

If you think there is a problem with your RAM, this tool can check your RAM and possibly fix the problem or let you know there is an issue. If you start seeing sudden freezes or crashes, it could mean there is a problem with your RAM.

#23. Open any website — “Insert website URL”

You can also enter the URL of any website in the Run dialog, and it will open it in your default browser. For example, if you type www.geekflare.com in the Run command, it will open the Geekflare home page in your default browser.

#24. Open Remote Desktop Connection — “mstsc”

You can use this feature to remotely connect to another PC and take full control over it. You’ll have to set up both PCs for the remote connection first, though. This Run command just makes the process easier.

#25. Open Command Prompt — “cmd”

Unlike PowerShell, you can’t access the Command Prompt by right-clicking on the start menu anymore. If you prefer using the Command Prompt over PowerShell to execute commands, this is one of the easier ways to open the Command Prompt.

Wrapping up

The cool thing about Run is that it remembers all the commands you type in it. Therefore, you will only have to type the first letter to enter the command in the future.

I also believe Run commands are more important in Windows 10 as it heavily promotes the use of its default Settings app. Most of the settings and apps that I have mentioned above are more difficult to access Windows 10.

Next, explore some of the best NirSoft utilities for Windows.

Windows commands

All supported versions of Windows (server and client) have a set of Win32 console commands built in.

This set of documentation describes the Windows Commands you can use to automate tasks by using scripts or scripting tools.

Prerequisites

The information that is contained in this topic applies to:

  • Windows Server 2019
  • Windows Server (Semi-Annual Channel)
  • Windows Server 2016
  • Windows Server 2012 R2
  • Windows Server 2012
  • Windows Server 2008 R2
  • Windows Server 2008
  • Windows 10
  • Windows 8.1

Command shell overview

The Command shell was the first shell built into Windows to automate routine tasks, like user account management or nightly backups, with batch (.bat) files. With Windows Script Host you could run more sophisticated scripts in the Command shell. For more information, see cscript or wscript. You can perform operations more efficiently by using scripts than you can by using the user interface. Scripts accept all Commands that are available at the command line.

Windows has two command shells: The Command shell and PowerShell. Each shell is a software program that provides direct communication between you and the operating system or application, providing an environment to automate IT operations.

PowerShell was designed to extend the capabilities of the Command shell to run PowerShell commands called cmdlets. Cmdlets are similar to Windows Commands but provide a more extensible scripting language. You can run Windows Commands and PowerShell cmdlets in Powershell, but the Command shell can only run Windows Commands and not PowerShell cmdlets.

For the most robust, up-to-date Windows automation, we recommend using PowerShell instead of Windows Commands or Windows Script Host for Windows automation.

You can also download and install PowerShell Core, the open source version of PowerShell.

Incorrectly editing the registry may severely damage your system. Before making the following changes to the registry, you should back up any valued data on the computer.

Читайте также:  Windows forms как установить иконку

To enable or disable file and directory name completion in the Command shell on a computer or user logon session, run regedit.exe and set the following reg_DWOrd value:

To set the reg_DWOrd value, use the hexadecimal value of a control character for a particular function (for example, 0 9 is Tab and 0 08 is Backspace). User-specified settings take precedence over computer settings, and command-line options take precedence over registry settings.

Command-line reference A-Z

To find information about a specific command, in the following A-Z menu, click the letter that the command starts with, and then click the command name.

Using command line arguments for Windows Terminal

You can use wt.exe to open a new instance of Windows Terminal from the command line. You can also use the execution alias wt instead.

If you built Windows Terminal from the source code on GitHub, you can open that build using wtd.exe or wtd .

Command line syntax

The wt command line accepts two types of values: options and commands. Options are a list of flags and other parameters that can control the behavior of the wt command line as a whole. Commands provide the action, or list of actions separated by semicolons, that should be implemented. If no command is specified, then the command is assumed to be new-tab by default.

To display a help message listing the available command line arguments, enter: wt -h , wt —help , wt -? , or wt /? .

Options and commands

Below is the full list of supported commands and options for the wt command line.

Option Description
—help , -h , -? , /? Displays the help message.
—maximized , -M Launches the terminal maximized.
—fullscreen , -F Launches the terminal as full screen.
—focus , -f Launches the terminal in the focus mode. Can be combined with maximized .
—window , -w Launches the terminal in a specific window.
Command Parameters Description
new-tab , nt —profile, -p profile-name , —startingDirectory, -d starting-directory , commandline , —title , —tabColor Creates a new tab.
split-pane , sp -H, —horizontal , -V, —vertical , —profile, -p profile-name , —startingDirectory, -d starting-directory , —title , —tabColor , —size, -s size , commandline , -D, —duplicate Splits a new pane.
focus-tab , ft —target, -t tab-index Focuses on a specific tab.
move-focus , mf direction Move focus between panes in the given direction. Accepts one of up , down , left , right .

When opening Windows Terminal from cmd (Command Prompt), if you want to use your custom «cmd» profile settings, you will need to use the command wt -p cmd . Otherwise, to run your default profile settings, just use wt cmd .

The -D, —duplicate parameter for split-pane is only available in Windows Terminal Preview.

Command line argument examples

Commands may vary slightly depending on which command line you’re using.

Target a specific window

The ability for the —window,-w parameter to accept window names is only available in Windows Terminal Preview.

Below are examples of how to target specific windows using the —window,-w option.

Execution aliases do not work in WSL distributions. If you want to use wt.exe from a WSL command line, you can spawn it from CMD directly by running cmd.exe . The /c option tells CMD to terminate after running.

Open a new profile instance

To open a new terminal instance, in this case the command will open the profile named «Ubuntu-18.04», enter:

Execution aliases do not work in WSL distributions. If you want to use wt.exe from a WSL command line, you can spawn it from CMD directly by running cmd.exe . The /c option tells CMD to terminate after running.

The -p flag is used to specify the Windows Terminal profile that should be opened. Substitute «Ubuntu-18.04» with the name of any terminal profile that you have installed. This will always open a new window. Windows Terminal is not yet capable of opening new tabs or panes in an existing instance.

Target a directory

To specify the folder that should be used as the starting directory for the console, in this case the d:\ directory, enter:

Execution aliases do not work in WSL distributions. If you want to use wt.exe from a WSL command line, you can spawn it from CMD directly by running cmd.exe . The /c option tells CMD to terminate after running.

Multiple tabs

To open a new terminal instance with multiple tabs, enter:

PowerShell uses a semicolon ; to delimit statements. To interpret a semicolon ; as a command delimiter for wt command-line arguments, you need to escape semicolon characters using backticks. PowerShell also has the stop parsing operator (—%), which instructs it to stop interpreting anything after it and just pass it on verbatim.

Execution aliases do not work in WSL distributions. If you want to use wt.exe from a WSL command line, you can spawn it from CMD directly by running cmd.exe . The /c option tells CMD to terminate after running.

To open a new terminal instance with multiple tabs, in this case a Command Prompt profile and a PowerShell profile, enter:

PowerShell uses a semicolon ; to delimit statements. To interpret a semicolon ; as a command delimiter for wt command-line arguments, you need to escape semicolon characters using backticks. PowerShell also has the stop parsing operator (—%), which instructs it to stop interpreting anything after it and just pass it on verbatim.

Execution aliases do not work in WSL distributions. If you want to use wt.exe from a WSL command line, you can spawn it from CMD directly by running cmd.exe . The /c option tells CMD to terminate after running and the \; backslash + semicolon separates commands.

Multiple panes

To open a new terminal instance with one tab containing three panes running a Command Prompt profile, a PowerShell profile, and your default profile running a WSL command line, enter:

PowerShell uses a semicolon ; to delimit statements. To interpret a semicolon ; as a command delimiter for wt command-line arguments, you need to escape semicolon characters using backticks. PowerShell also has the stop parsing operator (—%), which instructs it to stop interpreting anything after it and just pass it on verbatim.

Execution aliases do not work in WSL distributions. If you want to use wt.exe from a WSL command line, you can spawn it from CMD directly by running cmd.exe . The /c option tells CMD to terminate after running and the \; backslash + semicolon separates commands.

The -H flag (or —horizontal ) indicates that you would like the panes to be split horizontally. The -V flag (or —vertical ) indicates that you would like the panes split vertically.

Multiple tabs and panes

The new-tab and split-pane commands can be sequenced to get multiple tabs, each with split panes. To open a new terminal instance with two tabs, each with two panes running a Command Prompt and a WSL command line, with each tab in a different directory, enter:

PowerShell uses a semicolon ; to delimit statements. To interpret a semicolon ; as a command delimiter for wt command-line arguments, you need to escape semicolon characters using backticks. PowerShell also has the stop parsing operator (—%), which instructs it to stop interpreting anything after it and just pass it on verbatim.

Execution aliases do not work in WSL distributions. If you want to use wt.exe from a WSL command line, you can spawn it from CMD directly by running cmd.exe . The /c option tells CMD to terminate after running and the \; backslash + semicolon separates commands. Note to specify a Windows directory as the starting directory for wsl.exe that two backslashes \\ are required.

Tab title

To open a new terminal instance with custom tab titles, use the —title argument. To set the title of each tab when opening two tabs, enter:

Execution aliases do not work in WSL distributions. If you want to use wt.exe from a WSL command line, you can spawn it from CMD directly by running cmd.exe . The /c option tells CMD to terminate after running and the \; forward-slash + semicolon separates commands.

Using application title (Preview)

To open a new terminal instance allowing applications within it to set the tab title by sending title change messages, use the —useApplicationTitle flag. To suppress these messages, use the —suppressApplicationTitle flag. If none of these flags are provided, the behavior is inherited from the profile’s settings. To open a tab with title tabname that will not be overridden by the application, enter:

Execution aliases do not work in WSL distributions. If you want to use wt.exe from a WSL command line, you can spawn it from CMD directly by running cmd.exe . The /c option tells CMD to terminate after running and the \; backslash + semicolon separates commands.

This feature is only available in Windows Terminal Preview.

Tab color

To open a new terminal instance with custom tab colors, use the —tabColor argument. This argument overrides the value defined in the profile, but can be overridden as well using the tab color picker. In the following example, a new terminal is created with two tabs of different colors:

Execution aliases do not work in WSL distributions. If you want to use wt.exe from a WSL command line, you can spawn it from CMD directly by running cmd.exe . The /c option tells CMD to terminate after running and \; separates commands.

When —tabColor is set for a tab, it is associated with the first pane of this tab. Hence in a tab with multiple panes, the color will be applied only if the first pane is in focus. To set the tab color for additional panes, you will need to add the —tabColor parameter to the split-pane subcommand as well. In the example below, a tab with two panes is created with tab colors specified for each pane:

Color scheme (Preview)

To open a new terminal instance with a specific color scheme (instead of the colorScheme set in the profile), use the —colorScheme argument. This argument overrides the value defined in the profile.

Execution aliases do not work in WSL distributions. If you want to use wt.exe from a WSL command line, you can spawn it from CMD directly by running cmd.exe . The /c option tells CMD to terminate after running and \; separates commands.

This feature is only available in Windows Terminal Preview.

Tab focus

To open a new terminal instance with a specific tab in focus, use the -t flag (or —target ), along with the tab-index number. To open your default profile in the first tab and the «Ubuntu-18.04» profile focused in the second tab ( -t 1 ), enter:

Execution aliases do not work in WSL distributions. If you want to use wt.exe from a WSL command line, you can spawn it from CMD directly by running cmd.exe . The /c option tells CMD to terminate after running and the \; backslash + semicolon separates commands.

Examples of multiple commands from PowerShell

Windows Terminal uses the semicolon character ; as a delimiter for separating commands in the wt command line. Unfortunately, PowerShell also uses ; as a command separator. To work around this, you can use the following tricks to run multiple wt commands from PowerShell. In all the following examples, a new terminal window is created with three panes — one running Command Prompt, one with PowerShell, and the last one running WSL.

The following examples use the Start-Process command to run wt . For more information on why the terminal uses Start-Process , see Using start below.

Single quoted parameters

In this example, the wt parameters are wrapped in single quotes ( ‘ ). This syntax is useful if nothing is being calculated.

Escaped quotes

When passing a value contained in a variable to the wt command line, use the following syntax:

Note the usage of ` to escape the double-quotes ( » ) around «Windows PowerShell» in the -p parameter to the split-pane parameter.

Using start

All the above examples explicitly used start to launch the terminal.

The following examples do not use start to run the command line. Instead, there are two other methods of escaping the command line:

  • Only escaping the semicolons so that PowerShell will ignore them and pass them straight to wt .
  • Using —% , so PowerShell will treat the rest of the command line as arguments to the application.

In both of these examples, the newly created Windows Terminal window will create the window by correctly parsing all the provided command-line arguments.

However, these methods are not recommended currently, as PowerShell will wait for the newly-created terminal window to be closed before returning control to PowerShell. By default, PowerShell will always wait for Windows Store applications (like Windows Terminal) to close before returning to the prompt. Note that this is different than the behavior of Command Prompt, which will return to the prompt immediately.

Читайте также:  Move all files from one directory to another linux
Оцените статью