Launching Notepad++ from command line with -ro argument
I can never get the -ro argument to work. Has anybody tried it?
I usually open a bunch of files and then set them all as read only to prevent unintentional changes. I do this one tab at a time - too tedious. I would then clear the read only flag when I want to edit a specific file.
Feature request: Settings->Preferences->Editing - open files in read only as default checkbox.
welcome to the notepad++ community, @John-Dy-Chee-Puat
the -ro argument only works, if a file is not yet opened in a previous session.
the session has a higher priority and the read only setting of a session overrides the -ro switch.
if you want to open specific multiple files as read only, you can use the command line:
notepad++.exe -ro -nosession change.log license.txt.
note: this will disable session snapshot and periodic backup at the preferences, to try to avoid overwriting the previous session.xml.
recommended: if you usually open more or less the same bunch of files as read only, you can open those files, set them as read only, and save this as a session at
file > save sessionfor future use.
loading a saved session will set the saved read only status to the session’s state, regardless if the file is already opened in an opposite state.