How can I set PowerShell to start in my user folder?
Asked by
MellowPine47
Whenever I open PowerShell on Windows, it starts in `C:WindowsSystem32` instead of my user directory, such as `C:Usersmyname`. I know I can run `cd ~` manually, but I'd like PowerShell to open in the preferred directory automatically. What's the best way to configure this?
Answers
If you start PowerShell from a regular shortcut, open the shortcutโs properties and change the **Start in** directory to your desired path. That controls the working directory when the shortcut launches PowerShell.
Reply to this answer
If you launch PowerShell through Windows Terminal, edit that PowerShell profileโs starting directory and set it to something like `C:Usersmyname`. This is usually the cleanest option because it changes the location for that particular terminal profile without affecting every PowerShell session.
Reply to this answer
Also check whether PowerShell is being launched with elevated permissions. A normal user session commonly starts in the user directory, while an administrator session may start in `C:WindowsSystem32`. If you are already launching it normally, use the Windows Terminal or shortcut setting instead.
Reply to this answer
You can also use your PowerShell profile. Run `notepad $PROFILE`, add `Set-Location 'C:Usersmyname'`, save the file, and open a new PowerShell window. However, this runs for every session that loads the profile, so it may override a directory you intentionally launched PowerShell from. `Push-Location 'C:Usersmyname'` is another option, since `Pop-Location` can return you to the previous directory.
Reply to this answer
Add your answer
Answers are reviewed before publication.
MellowPine47: That worked for me. I used `notepad $PROFILE`, added the location command, and new sessions now start in my user folder.
QuartzFalcon19: One caveat: some enterprise systems block PowerShell scripts, which can prevent profiles from loading. In that situation, changing the Windows Terminal profile or shortcutโs **Start in** setting is a better approach.