saran4u
24th September 2012 13:29 UTC
How to set Readonly property of all the files in a particular folder
Hi to all,
I have tried the following for a single file and its working fine.
setFileAttributes "$INSTDIR\sample\File.txt" READONLY
But i want to set all the files like .txt, .c, .h of a particular folder in
ReadOnly mode.
How to do it.
Thanks in advance...:)
Anders
24th September 2012 14:05 UTC
Use the Find* functions in a loop...
saran4u
25th September 2012 05:14 UTC
sorry I couldn't get it.. pls give with a simple example..
Actually my requirement is have to set all the files in a folder in read only mode.
MSG
25th September 2012 06:21 UTC
Use FindFirst/FindNext/FindClose in a loop to find all *.someextension files. Then call setfileattributes for each file that's found.
http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.5.12
saran4u
29th September 2012 11:00 UTC
Read only property for a folder
ya thanks, it's working fine..
Instead of doing like this is it any way to set a whole folder and its sub directories in read only mode...?
Anders
29th September 2012 16:49 UTC
If you were programming in Win32 and the folder was on a NTFS drive you could use transactions, I don't really see the point though...