Shortcut to make something readonly/not readonly
6,990
Solution 1
Works under XP: Alt+Enter Alt+R Enter
Solution 2
attrib
is what you're looking for:
attrib +r readonlyfile.txt
attrib -r writeablefile.txt
help attrib
says:
Displays or changes file attributes.
ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H] [drive:][path][filename]
[/S [/D]]
+ Sets an attribute.
- Clears an attribute.
R Read-only file attribute.
A Archive file attribute.
S System file attribute.
H Hidden file attribute.
[drive:][path][filename]
Specifies a file or files for attrib to process.
/S Processes matching files in the current folder
and all subfolders.
/D Processes folders as well.
Author by
Peter Turner
Faithful Catholic - Father of 5, Husband of 1 Programmer of cloudish things from Southern Wisconsin.
Updated on September 17, 2022Comments
-
Peter Turner over 1 year
Is there a windows (explorer) shortcut or non-mouse oriented command to make a toggle a given file's read only status?
-
Peter Turner about 14 yearsGood answer, though it made me revise my original question because I really wanted a windows explorer shortcut. I'm thinking one doesn't exist, but maybe someone knows of an shell extension or something.
-
heavyd about 14 yearsPerhaps using a combination of
attrib
and the Send To folder would solve your problem. -
Joey about 14 yearsYou can also add a verb to the context menu which toggles it.
-
Dean Meehan about 5 yearsAdditionally confirmed to work under Windows 7
-
TheGeneral almost 3 yearsContinues to work under Windows 10.