vbscript to find Read-Only files

Status
Not open for further replies.

stubornallstar

Solid State Member
Messages
19
I am looking for a vbscript that would be able to go through a filesystem and locate files/folders set as Read-Only and change those to not Read-only. Any suggestions?
ty
 
I found some code that is aiming in the right direction. is there any vb pros out there that can help me shape this more into what im looking for?
Description
Demonstration script that checks to see if a file is read-only and, if it is not, marks it as read-only. Script must be run on the local computer.

Script Code

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile("C:\FSO\TestScript.vbs")
If objFile.Attributes = objFile.Attributes AND 1 Then
objFile.Attributes = objFile.Attributes XOR 1
End If
 
i need the file to be marked as NOT read-only. and id like it if it can run an entire file system at once. SUGGESSTIONS PLEASE : )
ty
 
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile("C:\FSO\TestScript.vbs")
If objFile.Attributes = objFile.Attributes AND 1 Then
objFile.Attributes = objFile.Attributes AND 0
End If

change xor 1 to and 0 for read/write permission
 
Status
Not open for further replies.
Back
Top Bottom