- Set path from command line
- How to set path from command line?
- Add directory to system path environment variable:
- Default option is not allowed more than ‘2’ time(s)
- Windows CMD: PATH Variable – Add To PATH – Echo PATH
- Echo Windows PATH Variable
- Add To Windows PATH
- Set Windows PATH For The Current Session
- Set Windows PATH Permanently
- 6 ways to open the Run command window in Windows
- 1. Open the Run command window with a keyboard shortcut
- 2. Use Search to open the Run command window
- 3. Open the Run command window from the Start Menu
- 4. Use the Command Prompt (CMD) to open the Run window
- 5. Open the Run command window with PowerShell
- 6. Use the WinX power user menu to open the Run window in Windows 10
- What do you want to access using the Run window?
- Useful Run Commands Every Windows User Should Know
- List of Run Commands
- More Run Commands
Set path from command line
Users can run an executable from windows command prompt either by giving the absolute path of the file or just by the executable file name. In the latter case, Windows searches for the executable in a list of folders which is configured in environment variables. These environment variables are as below.
1. System path
2. User path
The values of these variables can be checked in system properties( Run sysdm.cpl from Run or computer properties). Initially user specific path environment variable will be empty. Users can add paths of the directories having executables to this variable. Administrators can modify the system path environment variable also.
How to set path from command line?
In Vista, Windows 7 and Windows 8 we can set path from command line using ‘setx’ command.
For example, to add c:\dir1\dir2 to the path variable, we can run the below command.
Alternative way is to use Windows resource kit tools ‘pathman.exe‘. Using this command we can even remove a directory from path variable. See download windows resource kit tools. This works for Windows 7 also.
Add directory to system path environment variable:
Open administrator command prompt
Run the below command
Remove path from system path environment variable:
Run the below command from elevated command prompt
Setting user path environment variable
For user environment varlables, admin privileges are not required. We can run the below command to add a directory to user path environment variable.
To remove a directory from user path, you can run the below command.
Default option is not allowed more than ‘2’ time(s)
You get this error if you have not enclosed ‘path’ in double quotes. See the below example for setting the path of firefox.
Now if you move %path% to be in the double quotes
Could a context entry be created for folders, perhaps an extended one… to add to path?
what about a multi-verb option, like copy as path?
hi, when i use setx at an administrator command line, it creates a USER variable, NOT the SYSTEM variable. What am i doing wrong? How do i change the SYSTEM path at command prompt? -thx
Johny Why
Answer: Try add the parameter /M
Hi, is there a way I can add an extra variable instead on deleting the currently one and put a new Variable on the Path.
I used the command setx /M “c:\Options”, and what it does is delete the current one and then puts that one there, all I want is to add the new variable to the current one. -thx
Nuno, pathman described above does exactly that. You can download the resource tools kit and get it.
setx path “%path%;C:\yourFolder”
To set path for java & javac, can I add the paths to PATH or do I need to create the environment variable JAVA_HOME. I don’t have this defined, but windows does not seem to be able to find java binaries on my system.
You can directly add the folder to PATH. No need to define JAVA_HOME. However, adding JAVA_HOME separately avoids cluttering and helps to easily understand what is added.
hello, can someone plz explain this result? After setting path, it did not change. This was run from an Administrator command-line:
C:\Windows\system32>setx path “C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin;D:\Program Files (x86)\Microsoft VS Code\bin”
SUCCESS: Specified value was saved.
C:\Windows\system32>path
PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin;D:\Program Files (x86)\Microsoft VS Code\bin;D:\Program Files (x86)\metapad36;D:\Program Files (x86)\metapad36″ /M
Why won’t this work?
SET EPO = D:\Program Files (x86)\McAfee\ePolicy Orchestrator
PATH = %PATH%;%EPO%\jre\bin;%EPO%\apache2\bin
In windows 10 set path %path%; not working. it’s work like :
setx “%path%;C:\Program Files\CodeBlocks\MinGW\bin”
By unfortunately I deleted my system default path. How could I able to find my system path?
Unfortunately I deleted several files with unremembered path names. This article was useful
The following used to work for me when I am in MSDOS environment. Lately I get error messages such as INCLUDE not found. Why is this so?
Used to work
SET PLL =c:\CL5\PLL
SET PLT =c:\CL5\PLL
SET INCLUDE =c:\CL5\INCLUDE
SET PRG =c:\IMS\PRG
SET LIB =c:\CL5\LIB
SET OBJ =c:\CL5\OBJ
PATH =c:\IMS\EXE;\CL5\BIN;\CL5\NG;\CL5\PLL
pathman is one of many tools of the Windows Server 2003 Resource Kit Tools
Note: The Windows Server 2003 Resource Kit Tools are not supported on 64-bit platforms.
Huh.
When I did that on Windows 10 v1903, using setx, it replaced the USER scope paths with the SYSTEM scope paths.
Now I’m not sure what was in the old user path.
So, uh… Be careful out there.
And if anyone has a solution how to avoid that, please let me know
Thanks
Windows CMD: PATH Variable – Add To PATH – Echo PATH
PATH is an environment variable that specifies a set of directories, separated with semicolons ( ; ), where executable programs are located.
In this note i am showing how to print the contents of Windows PATH environment variable from the Windows command prompt.
I am also showing how to add a directory to Windows PATH permanently or for the current session only.
Cool Tip: List environment variables in Windows! Read More →
Echo Windows PATH Variable
Print the contents of the Windows PATH variable from cmd :
The above commands return all directories in Windows PATH environment variable on a single line separated with semicolons ( ; ) that is not very readable.
To print each entry of Windows PATH variable on a new line, execute:
Cool Tip: Set environment variables in Windows! Read More →
Add To Windows PATH
Warning! This solution may be destructive as Windows truncates PATH to 1024 characters. Make a backup of PATH before any modifications.
Save the contents of the Windows PATH environment variable to C:\path-backup.txt file:
Set Windows PATH For The Current Session
Set Windows PATH variable for the current session:
Set Windows PATH Permanently
Run as Administrator: The setx command is only available starting from Windows 7 and requires elevated command prompt.
Permanently add a directory to the user PATH variable:
Permanently add a directory to the system PATH variable (for all users):
Info: To see the changes after running setx – open a new command prompt.
6 ways to open the Run command window in Windows
The Run command window allows you to launch programs, open files and folders, and access internet resources in Windows. Just type a path or a quick command into the Windows Run box, and then click OK or press Enter to use a Run command. Although the Run shortcut is not as easy to find in recent Windows versions, the tool still exists, and there are plenty of ways to access it. This tutorial illustrates how to open Run in Windows 10 and Windows 7:
1. Open the Run command window with a keyboard shortcut
The fastest way to access the Run command window is to use the keyboard shortcut Windows + R. On top of being very easy to remember, this method is universal for all versions of Windows. Hold down the Windows key and then press R on your keyboard.
The Run window is immediately displayed in the lower-left corner of the screen.
2. Use Search to open the Run command window
As always in Windows, Search is a great idea to find just about anything. If you are using Windows 10, first type the word “run” inside the Search bar.
Then, click or tap on the relevant search result or press Open from the pane on the right.
In Windows 7, click the Start button and type the word “run” in the Start Menu Search box. Then, click the appropriate result to launch the Run command window.
3. Open the Run command window from the Start Menu
The Start Menu is a reliable way to access features on your Windows computer or device, including the Run window. In Windows 10, access the Start Menu by clicking or tapping on the Windows logo in the lower-left corner or by pressing the Windows button on your keyboard. Then, scroll down to the letter W, open the Windows System folder, and press Run.
In Windows 7, open the Start Menu and then access “All Programs -> Accessories -> Run” to launch the window.
Alternatively, you can also customize your Windows 7 Start Menu to permanently display a Run shortcut in the right-hand pane. To learn how to do that, read The complete guide to the Windows 7 Start Menu.
4. Use the Command Prompt (CMD) to open the Run window
Some of my colleagues love the CMD, so we decided to put this in for other fans, even if it’s not as easy to remember as the other ways illustrated in this article. To open the Windows Run, you can also launch the Command Prompt and enter the following:
explorer.exe Shell.
This method works both in Windows 10 and Windows 7.
5. Open the Run command window with PowerShell
Wondering how to open Run from PowerShell in Windows 10 and Windows 7? First, start PowerShell. Then, copy/paste or type in the following command:
(New-Object -ComObject “Shell.Application”).FileRun()
Press Enter on your keyboard, and the Run command window is immediately opened in the bottom-left corner.
6. Use the WinX power user menu to open the Run window in Windows 10
Windows 10 has a hidden power user menu that includes a shortcut for the Run command window. There are many ways to access this menu, the easiest being to use the Windows + X keyboard shortcut. Then, click or tap on Run or press R on your keyboard to open the Run box in Windows 10.
If the WinX power user menu interests you, you can learn more by reading: What is the WinX menu and how to open it.
What do you want to access using the Run window?
The Run command window was first introduced by Microsoft in Windows 95 and has been with us ever since. Some of us access it pretty often, but plenty of people don’t realize its potential and usefulness yet. We’re happy this feature caught your eye, but we are curious what brought you here. Are you looking for new ways to open the Windows Run command window or are you trying something new on your computer? Let us know in the comments.
Useful Run Commands Every Windows User Should Know
A quick-and-easy keyboard-only way to run Windows’ wealth of tools is through the “Run” command. If you know the corresponding Run command of a tool or task, then you know the quickest way to access said tool or task.
The following is a list of our favorite Run commands to help you be more productive.
Note: Press Win + R on your keyboard to open the Run dialog box, and enter any of the below commands to access the respective tool.
List of Run Commands
1. services.msc – When you enter “services.msc” and press the Enter button, it will open the Windows Services app where you can easily start, stop and configure other settings for each and every service individually. It’s quite helpful when you want to toggle a service.
2. mstsc – Entering “mstsc” into the Run dialog box opens the Remote Desktop Connection app which allows you to connect to another Windows computers over the local network or through the Internet. This helps you use the host computer as your own.
3. msinfo32 – If you want to quickly get your system information, then the “msinfo32” command is the way to go. At a glance it will display all the system details including the hardware resources and software environment.
4. sdclt – This command opens the Backup and Restore window that allows you to quickly set a backup schedule or restore any of your previous backups.
5. compmgmt.msc – The Computer Management app is where you can access almost all the advanced Windows modules like Event Viewer, Shared Folder, System Tools, etc.
6. cleanmgr – This command allows you to open the Windows Disk Cleanup utility. Once opened, simply select the drive your want to clean up and click the “OK” button.
7. eventvwr.msc – Windows Event Viewer is where Windows stores all the monitoring and troubleshooting messages. You can use this command to quickly access the Event Viewer application.
8. control – Every Windows user knows a thing or two about the Windows Control Panel, and using this command you can quickly access the Control Panel with some stumbling around.
9. mmc – Microsoft Management Console (MMC) is an advanced Windows module that is mainly aimed at system administrators and power users, as it sports all the tools required for configuring and monitoring a Windows system.
10. resmon – Whenever you want to check how your system resources are being utilized, simply use this Run command, and it displays everything from your CPU to Dist to Network.
11. \ – This is one of the lesser-known Run commands. Just enter the backslash into the Run dialog box, and it will open up the C drive. It is one of the quickest ways to access the C drive.
12. . – This is yet another lesser-known Run command. When executed, it opens the current user’s home folder which hosts all the other local folders like the Downloads, Documents, Desktop, Pictures, etc.
13. .. – When you execute these two dots in the Run dialog box, it will open up the Users folder which is located directly in the C drive.
14. calc – If you want to quickly open the built-in Windows calculator app, typing calc in the Run dialog box is the easiest way to do it.
15. cmd – Even Windows users have to deal with the command line sometimes. With this command you can quickly open the command prompt without administrator privileges.
16. powershell – If the command prompt is too old for you, then you may want to try PowerShell. Just type this command in the Run dialog box, and you will have your PowerShell opened without administrator privileges.
17. netplwiz – The general user accounts option is available through the Control Panel, but if you want to mess with the advanced user account options, then use this command to open the Advanced User Accounts window. If you want to deal with the Authorization Manager, then use the Run command azman.msc .
18. gpedit.msc – Group Policy Editor in Windows allows you to set and edit different Windows policies of a local or remote computer. Since Group Policy Editor is an advanced tool, it is buried deep inside Windows, and this Run command is the easiest way to access it.
19. lusrmgr.msc – Using this command, you can open the Local Users and Groups Manager where you can edit several properties of all the users and groups.
20. mrt – Every month Windows releases a newer version of Microsoft Windows Malicious Software Removal Tool through the Windows Update. This free tool helps you in cleaning some of the most popular malicious software from your Windows computer. This tool runs silently in the background, but if you want to run it manually, then use this Run command.
21. ncpa.cpl – Being an Internet user means that you have to deal with occasional (if not daily) network problems, and one way to troubleshoot your network connection is by accessing your Network Adapters. To access all your Network Adapters, you can use this Run command.
22. perfmon.msc – If you want to monitor the performance of your Windows computer and effects of the programs you run, running Performance Monitor will provide ample data. You can access the Performance Monitor using this command.
23. powercfg.cpl – Windows hosts a wide range of power options to deal with your computer’s power usage, and you can access all those Power Options using this command.
24. appwiz.cpl – Using this command you can quickly access the Programs and Features window where you can quickly uninstall your installed programs.
25. devmgmt.msc – Windows Device Manager is where you can manage all your hardware devices, and you can use this Run command to quickly access it. Alternatively, you can also use the command “hdwwiz.cpl.”
26. regedit – Regedit Run command can be used to access the Windows Registry, which is a hierarchical database that hosts all the configurations and settings of an operating system and the installed programs.
27. msconfig – Windows System Configuration is where you can edit different things like the boot options, startup options, services, etc. You can use this Run command to access the System Configuration window.
28. sysdm.cpl – If you ever want to access the System Properties window, then using this Run command opens it right up.
29. firewall.cpl – If you want to manage or configure your Windows firewall, then you can use this Run command to quickly access the Firewall window.
30. wuapp – Last but not least, you can use this command to check, manage and configure all your Windows update settings.
More Run Commands
Can’t get enough of the Run command? Here we have compiled a big list of all the Run commands available in Windows.
Task Name | Run Command |
---|---|
About Windows | winver |
Add a Device | devicepairingwizard |
Add Hardware Wizard | hdwwiz |
Advanced User Accounts | netplwiz |
Authorization Manager | azman |
Backup and Restore | sdclt |
Bluetooth File Transfer | fsquirt |
Calculator | calc |
Certificates | certmgr |
Change Computer Performance Settings | systempropertiesperformance |
Change Data Execution Prevention Settings | systempropertiesdataexecutionprevention |
Change Printer Settings | printui |
Character Map | charmap |
ClearType Tuner | cttune |
Color Management | colorcpl |
Command Prompt | cmd |
Component Services | comexp |
Component Services | dcomcnfg |
Computer Management | compmgmt |
Computer Management | compmgmtlauncher |
Connect to a Network Projector | netproj |
Connect to a Projector | displayswitch |
Control Panel | control |
Create A Shared Folder Wizard | shrpubw |
Create a System Repair Disc | recdisc |
Credential Backup and Restore Wizard | credwiz |
Data Execution Prevention | systempropertiesdataexecutionprevention |
Default Location | locationnotifications |
Device Manager | devmgmt |
Device Pairing Wizard | devicepairingwizard |
Diagnostics Troubleshooting Wizard | msdt |
Digitizer Calibration Tool | tabcal |
DirectX Diagnostic Tool | dxdiag |
Disk Cleanup | cleanmgr |
Disk Defragmenter | dfrgui |
Disk Management | diskmgmt |
Display | dpiscaling |
Display Color Calibration | dccw |
Display Switch | displayswitch |
DPAPI Key Migration Wizard | dpapimig |
Driver Verifier Manager | verifier |
Ease of Access Center | utilman |
Encrypting File System Wizard | rekeywiz |
Event Viewer | eventvwr |
Fax Cover Page Editor | fxscover |
File Signature Verification | sigverif |
Getting Started | gettingstarted |
IExpress Wizard | iexpress |
Import to Windows Contacts | wabmig* |
iSCSI Initiator Configuration Tool | iscsicpl |
iSCSI Initiator Properties | iscsicpl |
Language Pack Installer | lpksetup |
Local Group Policy Editor | gpedit |
Local Security Policy | secpol |
Local Users and Groups | lusrmgr |
Location Activity | locationnotifications |
Magnifier | magnify |
Malicious Software Removal Tool | mrt |
Manage Your File Encryption Certificates | rekeywiz |
Math Input Panel | mip* |
Microsoft Management Console | mmc |
Microsoft Support Diagnostic Tool | msdt |
NAP Client Configuration | napclcfg |
Narrator | narrator |
New Scan Wizard | wiaacmgr |
Notepad | notepad |
ODBC Data Source Administrator | odbcad32 |
ODBC Driver Configuration | odbcconf |
On-Screen Keyboard | osk |
Paint | mspaint |
Performance Monitor | perfmon |
Performance Options | systempropertiesperformance |
Phone Dialer | dialer |
Presentation Settings | presentationsettings |
Print Management | printmanagement |
Printer Migration | printbrmui |
Printer User Interface | printui |
Private Character Editor | eudcedit |
Problem Steps Recorder | psr |
Protected Content Migration | dpapimig |
Registry Editor | regedit |
Remote Access Phonebook | rasphone |
Remote Desktop Connection | mstsc |
Resource Monitor | resmon |
Resultant Set of Policy | rsop |
Securing the Windows Account Database | syskey |
Services | services |
Set Program Access and Computer Defaults | computerdefaults |
Share Creation Wizard | shrpubw |
Shared Folders | fsmgmt |
Snipping Tool | snippingtool |
Sound Recorder | soundrecorder |
SQL Server Client Network Utility | cliconfg |
Sticky Notes | stikynot |
Stored User Names and Passwords | credwiz |
Sync Center | mobsync |
System Configuration | msconfig |
System Configuration Editor | sysedit (This command doesn’t work in the 64-bit version of Windows.) |
System Information | msinfo32 |
System Properties (Advanced Tab) | systempropertiesadvanced |
System Properties (Computer Name Tab) | systempropertiescomputername |
System Properties (Hardware Tab) | systempropertieshardware |
System Properties (Remote Tab) | systempropertiesremote |
System Properties (System Protection Tab) | systempropertiesprotection |
System Restore | rstrui |
Tablet PC Input Panel | tabtip* |
Task Manager | taskmgr |
Task Scheduler | taskschd |
Trusted Platform Module (TPM) Management | tpm |
User Account Control Settings | useraccountcontrolsettings |
Utility Manager | utilman |
Version Reporter Applet | winver |
Volume Mixer | sndvol |
Windows Activation Client | slui |
Windows Anytime Upgrade Results | windowsanytimeupgraderesults |
Windows Contacts | wab* |
Windows Disc Image Burning Tool | isoburn |
Windows DVD Maker | dvdmaker* |
Windows Easy Transfer | migwiz* |
Windows Explorer | explorer |
Windows Fax and Scan | wfs |
Windows Features | optionalfeatures |
Windows Firewall with Advanced Security | wf |
Windows Help and Support | winhlp32 |
Windows Journal | journal* |
Windows Media Player | wmplayer* |
Windows Memory Diagnostic Scheduler | mdsched |
Windows Mobility Center | mblctr |
Windows Picture Acquisition Wizard | wiaacmgr |
Windows PowerShell | powershell* |
Windows PowerShell ISE | powershell_ise* |
Windows Remote Assistance | msra |
Windows Repair Disc | recdisc |
Windows Script Host | wscript |
Windows Update | wuapp |
Windows Update Standalone Installer | wusa |
WMI Management | wmimgmt |
WMI Tester | wbemtest |
WordPad | write |
XPS Viewer | xpsrchvw |
Access Screen Resolution page | desk.cpl |
Access Mouse properties | main.cpl |
Access Windows Action Center | wscui.cpl |
Access Network Adapters | ncpa.cpl |
Access Power Option | powercfg.cpl |
Access the Programs and Features Window | appwiz.cpl |
Access the System Properties | sysdm.cpl |
Access the Windows Firewall | firewall.cpl |
*You cannot run these commands from a command prompt or the search box. |
As you can see, the Windows Run command is one of the best utilities you can find in Windows. Besides the commands shared above that first come to mind, there are many other commands to access different parts of Windows. So if you think that we missed any of your favorite Run commands, do share them in the comments below.