SetAttr Statement
சரியான கோப்பு வகை தன்மையை தொகுத்தல்.
தொடரமைப்பு:
SetAttr கோப்பின் பெயரின் சரம், முழு எண்ணின் தன்மை
அளவுருக்கள்:
FileName: Name of the file, including the path, that you want to test attributes of. If you do not enter a path, SetAttr searches for the file in the current directory. You can also use URL notation.
தன்மைபிட் முறை நீங்கள் அமைக்க அல்லது அழிக்க வேண்டும் என்று பண்புகளை வரையறுக்கும்:
மதிப்பு
Named constant |
Value |
Definition |
ATTR_NORMAL |
0 |
Normal files. |
ATTR_READONLY |
1 |
Read-only files. |
ATTR_HIDDEN |
2 |
Hidden file |
You can set multiple attributes by combining the respective values with a logic OR statement.
எடுத்துக்காட்டு:
Sub ExampleSetGetAttr
On Error GoTo ErrorHandler ' Define target for error handler
If Dir("C:\test",16)="" Then MkDir "C:\test"
If Dir("C:\test\autoexec.sav")="" Then FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav"
SetAttr "c:\test\autoexec.sav" ,0
FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav"
SetAttr "c:\test\autoexec.sav" , ATTR_READONLY
Print GetAttr( "c:\test\autoexec.sav" )
End
ErrorHandler:
Print Error
End
End Sub