Scripting Guy Unlock Readonly Edit and Make It Readonly Again?
Hey, Scripting Guy! Can I "Unlock" a Read-Only File, Edit it, and Make It Read-Only Again?
Hey, Scripting Guy! Nosotros have a number of files that we need to admission at piece of work from time to fourth dimension. To protect these files, we make them read-only. This works great from a file protection standpoint, but it is really annoying when I need to make updates to the file considering most half the time I volition open up a file, brand the edits, and forget to articulate the read-only attribute. When I get to save my changes, that is when I am reminded that the file is read-only and it forces me to relieve the changes to a new file. So I have to go dorsum to the folder, rename the original file, and then rename the modified file to the original file name. All this ends upward costing me an extra five minutes of frustration and annoyance. I wish I had a script I could employ that would articulate the read-only attribute from all files in a folder. I could use that script earlier I start to work. So if I had some other script that would set the read-only aspect back to the files it would be cracking. What exercise you call up? Could you hook me up with a couple of scripts or what?
<
p mode="MARGIN: 0in 0in 8pt" grade="MsoNormal">– LM
Hullo LM, Microsoft Scripting Guy Ed Wilson hither.
Information technology is a cloudy overcast day in Charlotte, North Carolina, in the U.s.a. today. You would, of course, already know this, if you had friended me on Facebook. I am sipping a loving cup of Gunpowder Green Tea with a real cinnamon stick and lemon grass in it. I am listening to the Beach Boys on my newly upgraded Zune, and watching the ScriptingGuys on Twitter via my bDule software. I am in a good mood, and things are going great.
LM, I decided to write a single script that will display all read-just files in a folder, allow you to clear the read-but aspect, and then reset the read-simply attribute. To use the script, you specify the path to the folder, then use the appropriate switch to get, clear, or prepare the read-but attribute. The WorkWithReadOnlyFiles.ps1 script is pretty cool, and is seen here.
WorkWithReadOnlyFiles.ps1
Param ([string]$path='c:fso',
[switch]$get,
[switch]$clear,
[switch]$fix,
[switch]$aid
)
Post a Comment for "Scripting Guy Unlock Readonly Edit and Make It Readonly Again?"