Change the default location for saving sketches in Arduino IDE

By default, on a Windows machine, Arduino saves all the sketches in C:\Users\<Your User Name>\Documents\Arduino. Now, for whatever reason, you may want to change this default location. A common reason is that the C: has limited storage and you’d like to save sketches to a drive which has enough free space.

In order to change the default location, go to File → Preferences.

In the dialog box that opens up, the first input field is the Sketchbook location. Click on the ‘Browse’ button next to it and choose your desired path.

After changing the path, click OK. Now, if you try to save a new sketch, Arduino will default to the location you specified.