Default Save location
-
Hello,
I tried to stet this to my default Save location in the Preferences (extract from the config file):
<GUIConfig name=“openSaveDir” value=“2” defaultDirPath=“%userprofile%\Desktop” />
I close and reopen Notepad++. I create a new file, type something, hit “Save” and still it does not bring me to the desktop. However, if I just open up the Settings > Preference dialog, then Save again, it offers the Desktop.
Does anyone have the same issue ? How should I always want to save to the desktop and be prompted with that location first ?
Thanks a lot !
-
It works for me.
What version of Notepad++ (? menu, Debug Info, copy, then paste in your reply)
Also, did you confirm that the changes to
config.xml
were made in the rightconfig.xml
? The Debug Info will help you find that: ifLocal Conf Mode
is OFF, then the rightconfig.xml
will be%AppData%\Notepad++\config.xml
; if that mode is ON, then it will be<install path>\config.xml
(where<install path>
is the directory holdingnotepad++.exe
).Also, did you confirm that the changes to
config.xml
were properly saved? You can verify this by exiting Notepad++ and coming back in, and loading upconfig.xml
and making sure the changes are still there. Please note that Notepad++ overwritesconfig.xml
when it exits, so if even if you follow the Editing Config Files best-practices (as published today, Jun 6 2021), if you use Notepad++ to editconfig.xml
, you will lose your changes. (FYI: the online manual is being changed, to indicate that unlike other configuration files for Notepad++, you have to use a different editor forconfig.xml
(like MS Win’s builtinnotepad.exe
, or maybe a separate portable copy of Notepad++ that doesn’t use the sameconfig.xml
). This will be in the next update of the website.)When I make the change externally and use
<GUIConfig name="openSaveDir" value="2" defaultDirPath="%userprofile%\Desktop" />
, the next time I open Notepad++, File > New then File > Save As will default to my Desktop, File > Open will default to the Desktop, and Settings > Preferences > Default Directory confirms%userprofile%\Desktop
as the default location:
Further, if you just manually pick your desktop in Settings > Preferences > Default Directory, and then exit Notepad++ and come back in, it will keep your pick, and will still open or save-as from the Desktop; on my system, the setting looks like the following screenshot after closing and re-running Notepad++:
(All of these experiments were done with v7.9.5-64bit, but that logic hasn’t been changed in my recent memory, so it should work the same for most recent versions, including v8.0-RC3.)
-
Thank you very much Peter, that is a lot of information.
I will reply back after my working day. -
There was a bug when the Default Directory setting wasn’t remembered:
https://github.com/notepad-plus-plus/notepad-plus-plus/issues/9767
It has been fixed in v8. -
Thank you mere-human, I have exactly the same as in the post you linked to. Many thanks and I guess this topic can be closed.
-
Well, too quick I think.
I upgraded to version 8 64 bits. I create a new file, typ 1 letter, hit Ctrl-s and it defaults to the Notepad++ location. Notepad++ was already closed and restarted and the path in the settings is correct: %userprofile%\Desktop -
@Wim-Gielis said in Default Save location:
I upgraded to version 8 64 bits. I create a new file, typ 1 letter, hit Ctrl-s and it defaults to the Notepad++ location. Notepad++ was already closed and restarted and the path in the settings is correct: %userprofile%\Desktop
Works for me.
Is it time for you to post your Debug Info (from the?
menu)?
(As I see now, previously requested by Peter) -
Apologies, I must have missed that request.
Notepad++ v8 (64-bit)
Build time : Jun 6 2021 - 18:38:25
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line :
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 1909
OS Build : 18363.1082
Current ANSI codepage : 1252
Plugins : ComparePlugin.dll HTMLTag.dll mimeTools.dll NppConverter.dll NppExec.dll NppExport.dll NPPJSONViewer.dll NppSaveAsAdmin.dll PythonScript.dll qkNppReverseLines.dll QuickText.dll Remove Duplicate Lines.dll XMLTools.dll -
Maybe try running Notepad++ with the
-noPlugin
command-line-argument – it’s doubtful, but maybe one of your plugins is messing up that feature.If you go to Settings > Preferences > Default Directory, if you click on the
...
button, it should pop up your%userprofile%\Desktop
directory; if you hit Save, it should come back and the path in that entry should now have expanded to your actual userprofile directory (something like my examplec:\Users\Peter\Desktop
shown in my screenshot above).If it didn’t, that might mean that for some reason, Notepad++ cannot convert your
%userprofile%\Desktop
to an actual directory name (maybe there is some strange character, or it’s not properly defined?).OTOH, if it does convert after the
...
and save, does the feature of using that as default directory for saving and opening work on this instance? What about if you exit and re-start? If it works with the explicit directory name, then it would strengthen the argument that something in your value of%userprofile%
is confusing Notepad++. (But I will reiterate that my%userprofile%
variable works just fine.)Because whatever I try, if I have the entry set to a literal directory or a %variable%-including name, it will always use that directory as the default for open/save-as when I have that option enabled.
And today, instead of v7.9.5, I am using v8. So multiple versions, I still cannot replicate your results.
Notepad++ v8 (64-bit) Build time : Jun 6 2021 - 18:38:25 Path : C:\usr\local\apps\npp\npp.8.0.portable.x64\notepad++.exe Command Line : Admin mode : OFF Local Conf mode : ON Cloud Config : OFF OS Name : Windows 10 Enterprise (64-bit) OS Version : 1903 OS Build : 18362.1256 Current ANSI codepage : 1252 Plugins : mimeTools.dll NppConverter.dll NppExport.dll
-
Hi Peter,
-noPlugin does not help, same results. I see no plugins indeed, confirming that the no-Plugin command worked.
Clicking on the ellipsis, the D: drive comes up. In the box I have %userprofile%\Desktop, still D: shows up.
If I ctrl-o in Notepad++ and paste %userprofile%\Desktop, it goes to to the desktop. It could indicate that Notepad++ finds no issues with translating the %path% path to a literal path.
“f you hit Save, it should come back and the path in that entry should now have expanded to your actual userprofile directory (something like my example c:\Users\Peter\Desktop shown in my screenshot above).”
==> it translated to: D:\OneDrive\OneDrive - Aexis NV\Bureaublad (Bueaublad is Dutch for desktop)After that, hitting Save brings me to the Desktop, which is good ! Also after restart. The icing on the cake would be to be able to use %userprofile%\Desktop, such that if I copy my config.xml file to a remote computer, it would also default to the desktop there :-)
Could OneDrive be causing an issue ?
-
@Wim-Gielis said in Default Save location:
Could OneDrive be causing an issue ?
If OneDrive were intermittently not letting Notepad++ see that directory, then Notepad++ might just ignore that setting…
I have OneDriveForBusiness at work; when I set
%SpacedVariable%
to my one-drive folder, then set<GUIConfig name="openSaveDir" value="2" defaultDirPath="%SpacedFolder%" />
, then started Notepad++ v8.0-64bit, it works as expected, with Notepad++ defaulting to my OneDriveForBusiness folder (which, like you, has spaces and hyphens in it) for both SaveAs and Open operations.I don’t know why your instance is having trouble interpreting the
%userprofile%
variable correctly.The icing on the cake would be to be able to use %userprofile%\Desktop, such that if I copy my config.xml file to a remote computer, it would also default to the desktop there
Unfortunately, I am not sure that you are going to be able to ice that cake, due to your current setup having strange difficulties with that variable.
-
Indeed, a strange behavior but thanks for the confirmation anyway.
-
Works for me in Notepad++ v8.
My guess is that %userprofile% is invalid at some point.
@Wim-Gielis Did you try absolute path?Also, what of your configs are stored in OneDrive folder? This one or something different?
Maybe at some point, the folder is locked because of the OneDrive sync which could be the problem.