Как изменить путь в командной строке с c users имя пользователя на c windows system32

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.

setx path "%path%;c:\directoryPath"

For example, to add c:\dir1\dir2 to the path variable, we can run the below command.

setx path "%path%;c:\dir1\dir2"

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

pathman /as directoryPath

Remove path from system path environment variable:
Run the below command from elevated command prompt

pathman /rs directoryPath

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.

pathman /au directoryPath

To remove a directory from user path, you can run the below command.

pathman /ru directoryPath

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.

C:\Users\>setx path %path%;"c:\Program Files (x86)\Mozilla Firefox\"
ERROR: Invalid syntax. Default option is not allowed more than '2' time(s).
Type "SETX /?" for usage.

Now if you move %path% to be in the double quotes

C:\Users\>setx path "%path%;c:\Program Files (x86)\Mozilla Firefox\"
SUCCESS: Specified value was saved.
C:\Users\>

Download Article

A comprehensive Guide to Changing Directories in the Windows Command Prompt

Download Article

  • Opening Command Prompt
  • |

  • Changing the Directory
  • |

  • Other Directory Commands
  • |

  • Troubleshooting
  • |

  • Q&A
  • |

  • Tips
  • |

  • Warnings

Do you want to know how to change directories in the Windows Command Prompt (CMD)? The Windows Command Prompt allows you to use a variety of advanced commands that give you more control over your computer. However, when learning to use the Command Prompt, you will need to learn some basic commands, including how to navigate by changing directories. A directory is just another name for a folder. This wikiHow teaches you how to change directories in the Windows Command Prompt. To make changes in Command Prompt, you must be using an administrator account.

How to Change Directory in CMD: Quick Steps

In Command Prompt (CMD), type «cd» with a space after it, followed by the name of the directory (or drag and drop the directory into CMD from File Explorer). Then press «Enter.»

  1. Step 1 Open the Windows Start menu icon.

    To do so, click the icon with the Windows logo in the taskbar at the bottom of the screen. Alternatively, you can press the Windows key.

    • For Windows 8, place your mouse cursor in the top-right corner of the screen, then click the magnifying glass icon when it appears.
  2. Step 2 Type in cmd.

    This will bring up the Command Prompt icon at the top of the Start window.

    Advertisement

  3. Step 3 Right-click Command Prompt icon.

    It resembles a black box with a white cursor. This displays a drop-down menu.

  4. Step 4 Click Run as administrator.

    It’s near the top of the drop-down menu. Doing so will open the Command Prompt with administrator privileges.

    • Confirm this choice by clicking Yes when prompted.
    • You won’t be able to run Command Prompt in administrator mode if you are not signed into an Administrative account, or if you’re on a restricted, public, or networked computer (e.g., a library or school computer).
  5. Advertisement

  1. Step 1 Type in cd  followed by a space.

    This command, which stands for «change directory», is the root of any directory change.

    • Don’t press the «Enter» key just yet.
    • Alternatively, you can type chdir. This command does the exact same thing as «cd.»[1]
  2. Step 2 Determine your directory's path.

    A directory path is like a map to a specific folder. For example, if the directory to which you want to change is the «System32» folder that’s, in the «Windows» folder on the hard drive, the path would be «C:\Windows\System32\.»

    • You can find a folder by navigating to it in File Explorer. Click the address bar at the top to display the path to the folder you are currently in.
    • You can display a list of all directories in your current directory in the Command Prompt by typing dir and pressing «Enter
  3. Step 3 Type in your directory's path.

    Your command or address goes after the «cd» command; make sure there is a space between «cd» and your command.

    • For example, your whole command might look like cd Windows\System32.
    • Alternatively, you can drag and drop a folder from File Explorer into the Command Prompt.
    • If the directory is in the current drive you are in, you do not need to type the drive letter at the beginning of the path.
  4. Step 4 Press ↵ Enter.

    Doing so will change the Command Prompt directory to your selected one. The current directory you are in is listed next to the text cursor (i.e. «C:\Windows\System32>».)

  5. Advertisement

  1. Step 1 Type cd..

    and press Enter to go back a directory. If you want to go back one directory (i.e. change from «C:\Windows\System32» to «C:\Windows»), simply type «cd..» with two periods and press «Enter

  2. Step 2 Type cd\ and press ↵ Enter to return to the root of your drive.

    If you want to go back to the root of your drive (i.e. go from «C:\Windows\System32» to «C:\»), simply type «cd\» with a back slash and press «Enter

  3. Step 3 Type a drive letter and press ↵ Enter to change drives.

    If you try using the «cd» command to change directories to a directory that is on another drive, you will notice it does not work. You need to change drives before changing to a directory on that drive. To do so, type the drive letter (i.e. «D:») with a colon and press «Enter» to change drives.

    • Alternatively, you can type cd /d followed by the complete path (including the drive letter) of a directory on another drive to change directly to that drive (i.e. «cd /d D:\Documents».)
  4. Step 4 Type dir and press ↵ Enter to list directories in your current directory.

    If you are not sure what directories are in your current directory, you can display a list of all the directories by typing «dir» and pressing «Enter

  5. Advertisement

  1. Step 1 Check that you are spelling the directory name correctly.

    If you receive an error message that says «The system cannot find the path specified,» check to make sure you are spelling the name of the directory correctly. You can see a list of all directories in your current directory by typing dir and pressing «Enter

  2. Step 2 Check to make sure the directory exists.

    If you are spelling is correct and you are still getting the same error, open File Explorer and check to make sure the directory you are navigating to actually exists and that it’s located where you think it’s located.

    • If the directory does not exist, you can create a new directory by typing mkdir followed by a space, followed by the name of the directory you want to create. Then press «Enter
  3. Step 3 Make sure the directory is located on the drive that you are currently in.

    The «cd» command will not allow you to change to a directory on another drive. If you are currently in the «C:» drive, but the directory you want to change to is on the «D:» drive, you will need to change drive letters before changing to a new directly. You can do so by typing the drive letter and pressing «Enter

  4. Step 4 Make sure you are running the Command Prompt as an administrator.

    If you are not running the Command Prompt as an administrator, you will be limited in what you can do with the Command Prompt. Make sure you are logged into Windows as an Administrator, then right-click the CMD icon in the Start menu and click Run as Administrator.

  5. Advertisement

Add New Question

  • Question

    How do I go to C:\ from C:\users\username?

    You can either type «cd ..» to take you up a directory level (to C:\users) and once again to take you to the root level, or you can always type «cd \» from any directory to take you to the root level.

  • Question

    How do I change the name of a drive, like from Drive H: to drive A:?

    In start, type Computer Management. Open Computer Management and click the arrow next to Storage, then Disk Management. Right-click the drive you want to rename and click Change Drive Letter.

  • Question

    What is the difference between cd\ and cd?

    In order to use cd you have to put a file path after it; cd\ just goes straight to C:\.

See more answers

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

Advertisement

  • Changing the directory is useful when attempting to modify or delete a file in a specific location.

Thanks for submitting a tip for review!

Advertisement

  • Attempting to run a command that is contingent on a specific file or folder while in a different directory will result in errors.

Advertisement

About This Article

Thanks to all authors for creating a page that has been read 2,971,021 times.

Is this article up to date?

The navigation features in the Command Prompt are very helpful. If you are currently in the system32 path in the command prompt and you are wise to return to the Users folder, then if you may have difficulties, then you are on the right path.

Ourtechroom will guide you through various techniques for How to navigate to the Users folder quickly and easily from the System32 folder.

Table of Contents

  • What is the System32 folder?
  • What is a Users Folder?
  • Why navigate to User Folder?
  • Ways of Navigating to the Users Folder From the System32 Folder
    • 1 Using Absolute Path
    • 2 Using Relative Path (Tranvesing Techniques)
  • Navigating from any current path to Users Folder

What is the System32 folder?

The system32 directory is a specialized folder that contains files and folders which is essential for the operation of Windows OS. It stores Windows system files and software program files.

What is a Users Folder?

The User Profile Folder is created for each user account that you have in your Windows system. It stores essential information such as documents, pictures, downloads, and other personal data.

Note: For the purposes of this demonstration, I’m going to assume that your OS is installed on the C: drive.

Why navigate to User Folder?

When you need to view user-specific files or folders on your Windows computer, you may need to navigate from System32 to User. The User folder includes a computer user’s personal files, settings, and other data. This folder contains user-specific files and options.

To find a configuration or log file for a program that is only in the user’s profile, you may need to go to the User folder. A user’s desktop file may be in the User folder’s Desktop area. Navigating to the User area can help with user account issues and data access.

Ways of Navigating to the Users Folder From the System32 Folder

Here are a few ways to navigate to the Users Folder from the System32 folder.

1 Using Absolute Path

If you begin a path in the command prompt with a backslash, it is considered an «absolute path.».We mainly use a backslash(«/») for navigating paths for Windows Files and Folders.

Suppose you are currently in the System32 folder and wise to navigate to the Users folder then simply type as below.

C:\Windows\System32> cd /Users 

Note that: Command Prompt is noncase sensitive. So, Users, users, USers, etc are all treated in the same way.

cd user

fig. Navigate to the Users Folder 

If you want to view the content inside Users then just type:

C:\Users> dir

dir-user-profile

fig. View content inside Users folder

In Windows Environment, forward-slash(«\») also works well as shown below.

C:\Windows\System32> cd \Users 

What will happens if no backslash or forward slash?

If you type without backslash then will get an error because in this case command prompt will treat it as a relative path

C:\Windows\Sytem32> cd Users 
The system cannot find the path specified. 

This means you are trying to find the Users folder inside the System32 folder which does not exist ie. C:\Windows\System32\Users does not exist.

2 Using Relative Path (Tranvesing Techniques)

As we know that Users folder is located inside C: drive. So When you want to get to the users’ folder path from System32, all you have to do is go up two levels.

Example:

C:\Windows\System32> cd ..\..\Users 

Navigating from any current path to Users Folder

For example, if you’re in the D: drive in the command prompt and want to go back to the user’s directory, the steps are very straightforward. You first have to navigate to C: folder and then type cd /Users as usual.

E:\Tutorials> c: 
C:\Windows\System32> cd \Users 

Currently, I am in the Tutorials folder of E: drive, so first type C: for navigating to C and then type cd \Users. If you are using Windows 11 then simply typing C: will navigate you to the Users folder.

FAQ:

How to find the Current User Profile Path using Command Prompt?

For this, we use user profile environment variables. You can navigate to the current user profile path by simply typing the below code in Command Prompt:

cd %userprofile% 

%Userprofile% refers to the path “C:\Users\yourusername\»

Quick Links

  • What Is the Windows System PATH?

  • How to Add a Folder to Your PATH

Summary

The PATH tells Windows where it should look for executables, making them accessible via command-line interfaces or scripts. To add a new folder to PATH, navigate to Advanced System Settings > Environment Variables, select PATH, click «Edit» and then «New.»

Have you ever wondered why you can just type ipconfig into a command prompt and it works, but when you want to use a command line program you downloaded you have to navigate to its directory first? Here’s how to fix that using the Windows System PATH on Windows 10 and Windows 11.

What Is the Windows System PATH?

The Windows System PATH tells your PC where it can find specific directories that contain executable files. Ipconfig.exe, for example, is found in the C:\Windows\System32 directory, which is a part of the system PATH by default. When you type ipconfig into a Command Prompt, Windows doesn’t need to know where that EXE is—it’ll check all the folders in its PATH until it finds the right one.

If you’ve downloaded a program that uses a command-line interface—like ADB, the Android Debug Bridge—you can’t just type adb in the Command Prompt or PowerShell to run it, like you can with Windows’ built-in commands (e.g.ipconfig). Instead, you have to tell Command Prompt where to find that file, by typing in the full path of the EXE:

C:\Android\platform-tools\adb.exe

If you don’t, you’ll get an error message like this.

ADB is not recognized since it is not on the system PATH.

That’s a lot of typing, especially for something you have to run often.

If you want the same convenience with a program you downloaded (like ADB), you need to add its folder to Windows’ system PATH. That way, when you need to run adb, you can just run:

adb

No extra typing necessary.

How to Add a Folder to Your PATH

These steps are basically the same on Windows 10 and Windows 11. There are just some minor differences in the user interface.

Start by pressing the Windows key to open up the Start Menu, then search for «advanced system settings.» You can alternatively browse through Control Panel to System and Security > System and click on the «Advanced system settings» hyperlink in the left-hand pane.

Search for and open "Advanced System Settings."

Once the System Properties window opens, click on the «Environment Variables» button.

Click "Environment Variables."

In the «System Variables» box, look for a variable called Path. Select that and click on the «Edit» button.

You can modify the PATH for only the current user by changing the PATH variable under «User Variables.» It won’t affect other users, however. In many cases, it is better and more convenient to add something to the system PATH, so it is universally accessible on your PC.

Select "PATH" under "System Variables," then click "Edit."

This process is both easier and less confusing in Windows 10 and Windows 11 than it was in earlier versions of Windows. Once you’ve clicked the edit button, a new dialog box will appear with each location in the PATH on a separate line. This is a dramatic improvement over the way previous versions of Windows handled PATH locations and makes easy work of adding a new one.

The current PATH.

First, click the ‘new’ button, which will add a line at the end of the list. Add your location—»C:\AndroidSDK» in our example—and hit Enter. Click the «OK» button and you’re finished.

Older versions of Windows required each line end with a semi-colon, but Windows 10 and 11 do not if you use the user interface like we are here. If you use a command-line interface to edit the PATH, you’ll still find them there.

Click "New," enter the path to ADB, then click "OK."

The Android Debugging Bridge should now be accessible from any Command Prompt, PowerShell, or Windows Terminal, with no need to specify its directory.

ADB now works in PowerShell without specifying the path manually.

You can add as many locations as you like to PATH. However, convention and best practice dictate that you try to avoid cluttering up your PATH with unnecessary executables.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Как сделать деинсталляцию на windows
  • Как сделать второй виртуальный рабочий стол windows
  • Как установить ucds на windows 10
  • Windows 10 pro хеш сумма
  • Нужна ли оптимизация доставки в windows 10