In vb script, it is possible to read and modify the attributes of a file. In windows file attributes are stored in "Byte". A "Byte" consists on 8 bits. Each bit is used to indicate one property of the file. Following image depicts what are the properties each bit represents and decimal value corresponding to each attribute. (Decimal value of a property is the decimal equivalent of the binary when only that property is set).

In order to check any property, we have to check whether the value of the corresponding bit is 1 or 0. This done using the bitwise AND operator. ie, (Property Value) AND 4 = (Property Value), then the file is a "System File", (Property Value) AND 16 = (Property Value), then file is a "Directory File" etc
Similarly, to modify the value of a bit, we can use bitwise XOR. XOR will change 1 to 0 and 0 to 1. ie, (Property Value) XOR 4 will change a normal file to system file; and a system file to normal file.
(Property Value) OR 4 will change normal file to system file. No change will happen to system file.
Following is an example which reads and modifies the attributes of a file.
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile("C:\TestFile.txt")
'Checking whether file is read-only
If objFile.Attributes = objFile.Attributes AND 1 Then
WScript.Echo("File is read only")
End If
'Checking whether file is hidden
If objFile.Attributes = objFile.Attributes AND 2 Then
WScript.Echo("File is Hidden")
End If
'Changing the file to hidden
objFile.Attributes = objFile.Attributes OR 2
'Removing the read-only property
If objFile.Attributes = objFile.Attributes AND 1 Then
objFile.Attributes = objFile.Attributes XOR 1
WScript.Echo("Removed read-only property")
End If