Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Removing ReadOnly attribute for folder

$
0
0

Hi Everyone,

I am trying to remove the ReadOnly check mark from a folder. I have used the VBscript option and the script is below. The script executes, but does not remove the check mark

' Modify Folder Attributes
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("C:\FSO")

If objFolder.Attributes = objFolder.AttributesAND0Then
    objFolder.Attributes = objFolder.AttributesXOR0
EndIf

Have also tried the attrib command as mentioned below. This also does not work. When we enumerate the folder attributes, it returns values 16 pointing to a directory. I gave full permission to the Users and then also it fails. Please help me with this :-)

C:\>attrib -r "C:\FSO"


AppGN


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>