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