Julia starts in system32 by default

I installed Julia using the recommended winget method. When I launch Julia from the start menu, the default working directory is

julia> pwd()
"C:\\WINDOWS\\system32"

This causes problems when trying to install packages into a new environment. Is this working as designed?

Doesnt help much, but I can tell you it is not working as intended for you.
I also use winget on Windows, and Julia starts in my home directory (=intended). I dont know what could be the reason for this behavior on your side though.

My laptop is university-managed and actually blocks the Microstoft Store, so I was quite surprised when the winget command worked and installed Julia. If I start Julia from Windows PowerShell then it launches in the current directory as expected.

If you care about using the start menu, you should be able to open Properties for the Julia shortcut and change the “Start in” directory.

  1. Right click on Julia in your start menu and select More > Open file location
  2. Right click on the Julia shortcut in the window that appears and select Properties
  3. In the Properties dialog, change to your preferred startup directory.

The entry in the start menu is not a typical app shortcut and doesn’t appear to have a “properties” feature. I’m using Windows 11 if that helps.

Sorry, I’m on Windows 10 and I haven’t used 11.

Maybe this helps: Redirecting

Nevermind my previous comment, Im at home now and it actually also starts under “C:\WINDOWS\system32”. I probably had it installed diffferently on my work PC. It would indeed be better if it started in the home folder instead.

I run Linux on my computer at home, but on Monday I’ll try the portable Windows installer and see if I have the same issue.

I have run into this issue when my Windows home directory becomes inaccessible for some reason, typically because my home directory is set to some network file share location.

This usually involves the following environment variables %UserProfile% or %HomeDrive%%HomePath%.

FWIW, I have a practice of typing 0-arg cd.

shell> cd
C:\Users\username

shell> cd .julia/dev/SomeFabulousPackages
1 Like