How to change default new project location

Hello everybody, i have another question since i can’t find an answer for my problem anywhere else.
How to change default new project location in PlatformIO Home ?
Is there a config file to edit because i tried to find it without luck.

3 Likes

What is your operation system?

I am working on Win 10 but i think it would also be informative how it works on linux.
Thank you.

See Redirecting...

Please open PlatformIO IDE Terminal and type:

pio settings set projects_dir /new/path/projects/dir

Restart PlatformIO IDE.

3 Likes

Hello,
and how does it work with windows 7?
many thanks in advance.

When I open Terminal in PFIO IDE, I get another menu.
I select New Terminal and it takes me to Powershell.
I get the message ‘settings’ is not recognised…
What am I doing wrong?

Please use “PlatformIO Icon (left side bar) > Misc > New Terminal”

2 Likes

Thanks. I found it under Quick Access.

Sorry. I can’t seem to make it work.
Could you give me a sample?
I want to use C:/documents/PlatformIO/projects
Thanks

Then write C:/documents/PlatformIO/projects/.
You were setting wrong paths (with leading slash) on the screenshot. This is invalid path syntax in Windows.

1 Like

It’s working. I was getting a home directory on “onedrive” so had files all over the place. Managed to clear that off so hopefully, my libraries and projects will be on my computer from now on.
Thanks

  1. Open New Terminal in QUICK ACCESS
  2. type : cd “(your new project location)”
  3. type : pio settings set projects_dir “(your new project location)”
  4. Restart PIO extension or Visual Studio
  5. Change your environment with new project

    – Your new project already default –

(if not found new project location)

  1. find your new project location in Open QUICK ACCESS

Ubuntu/linux : in the terminal : set new location is : pio settings set projects_dir /your/new/project/location

No " " needed in my Pio core 5.2.4 home 3.4.0

Hi. I’m unable to set projects_dir. It appears to immediately revert to the default directory. Does PIO support using a different drive for Projects home? I prefer to keep my workspace on a separate drive so it’s not included in OS backup.

Win11
VS Code 1.74.2
PIO core 6.1.5
PIO home 3.4.3

PS C:\Users\David####> pio settings get projects_dir
Name          Current value [Default]                                    Description
------------  ---------------------------------------------------------  ----------------------------------------------------------
projects_dir  D:\PlatformIO\Projects                                     Default location for PlatformIO projects (PlatformIO Home)
              [C:\Users\David####\Documents\PlatformIO\Projects]
PS C:\Users\David####>

I also tried setting a user environment variable in Windows, including restart, but it has no effect.
PLATFORMIO_SETTING_PROJECTS_DIR D:\PlatformIO\Projects

Update: Realized VS2022 will take much more space than PIO Projects, so I’ll just keep it all on one drive.

Just chiming in to say I’ve had to google this every time I set up a new system, which recently has been about once a month. The crux of the issue here is my own brain, memorizing this command just won’t stick in my brain :wink: For something as fundamental as setting a default project location, I’d LOVE if this could be part of the extension’s GUI! I’m positive I’m not the only one who’d benefit, especially folks who are new to platform.io and would rather dig right into development rather than googling admin/setup solutions.

Anyway, thanks for the thread! It’s come in handy multiple times lol

Thanks for previous help. It helped … almost

My problem is I have a path with a SPACE in my path. (sorry but that’s on my windows machine the name where my working files are) the directory is

D:\D# Dossiers\Programmeren

nb. There is also a ‘#’ in it… but i ruled that problem out…

D:\D#Dossiers\Programmeren

did work…

Is there a special code for a SPACE in the path??

SOLUTION for future users with same issues!!

For something else I red about terminal commands in Visual Studio Code. Someone entered a path in “quotes”…

so I tried

pio settings set projects_dir “D:\D# Dossiers\Programmeren”

And THAT did the job.

How to use variables? As example %UserProfile%\OneDrive!PlatformIO\Projects ?

pio settings set projects_dir %UserProfile%\OneDrive\Project\!PlatformIO\Projects
This command corrects the user’s folder path on the current computer. And I want the path to be different for each computer when synchronizing parameters… although it seems platformio does not support vscode synchronization?