Answered by:
VBScript - Changing Folder Attribute

-
Hi,
I have a folder name FSO on my c drive. Inside this folder I have different type of file.
I want to create a VBscript that will allow me to set the entire folder on Read-Only so data inside won`t be modify.
Right now I have the following statement but it does not work.
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("C:\FSO")
If objFolder.Attributes = objFolder.Attributes AND 1 Then
objFolder.Attributes = objFolder.Attributes XOR 1
End If
Question
Answers
-
- Proposed as answer by Mike Laughlin Friday, September 27, 2013 12:09 AM
- Marked as answer by Bill_StewartModerator Thursday, November 07, 2013 8:02 PM
All replies
-
-
The FSO is only a test folder to I can make sure the script is running fine.
The actual folder is located in the user profile and I have over 500 pc to do so I`m not going to right click each and every computer. This is the reason why I mention I want to create a VBScript file
Thanks for the quick answer
-
-
You can set this globally using a GPO. Just define the folder you want to guard and set the security in the GPO. It will apply to all computers within about 30 minutes to one hour.
The Read-only attribute of a folder does nothing in NTFS. You are wasting your time.
Use GP and set folder security to everyone read and Admins FULL. It takes about 5 minutes to define the GPO.
¯\_(ツ)_/¯
-
Here is the story,
I want to prevent user from modifying their outlook signature. To achieve this I thought about creating a VBS files that is going to be push by a GPO that contain a value to put the signature folder in read-only so most of the users will not know how to modify it and if a support technician needs to modify it he can just remove the check mark from the read only modify it and but the check mark back.
By doing this instead of having 1000 users modifying their signature i`m only going to have about 10 so it`s easier after to deal with those 10 users.
I did check some software that can add signature on the exchange server directly but the Issus with this is it`s adding the signature at the complete end so If you have a bunch of reply/forward all your signature are at the end the email and not the text you just add.
-
-
- Proposed as answer by Mike Laughlin Friday, September 27, 2013 12:09 AM
- Marked as answer by Bill_StewartModerator Thursday, November 07, 2013 8:02 PM