SetAttr Statement

αž€αŸ†αžŽαžαŸ‹β€‹αž–αŸαžαŸŒαž˜αžΆαž“β€‹αž‚αž»αžŽβ€‹αž›αž€αŸ’αžαžŽαŸˆ αžŸαž˜αŸ’αžšαžΆαž”αŸ‹β€‹αž―αž€αžŸαžΆαžšαžŠαŸ‚αž›β€‹αž”αžΆαž“β€‹αž”αž‰αŸ’αž‡αžΆαž€αŸ‹β€‹β€‹β€‹αž˜αž½αž™Β αŸ”

αžœαžΆαž€αŸ’αž™β€‹αžŸαž˜αŸ’αž–αž“αŸ’αž’ αŸ–


SetAttr FileName As String, Attribute As Integer

αž”αŸ‰αžΆαžšαŸ‰αžΆαž˜αŸ‰αŸ‚αžαŸ’αžš αŸ–

FileName αŸ– αžˆαŸ’αž˜αŸ„αŸ‡β€‹αž―αž€αžŸαžΆαžšβ€‹ αžšαž½αž˜β€‹αž‘αžΆαŸ†αž„β€‹αž•αŸ’αž›αžΌαžœ αžŠαŸ‚αž›β€‹αž’αŸ’αž“αž€β€‹αž…αž„αŸ‹αžŸαžΆαž€αž›αŸ’αž”αž„β€‹β€‹αž‚αž»αžŽβ€‹αž›αž€αŸ’αžαžŽαŸˆβ€‹β€‹Β αŸ” αž”αŸ’αžšαžŸαž·αž“β€‹αž”αžΎβ€‹αž’αŸ’αž“αž€β€‹αž˜αž·αž“β€‹αž…αž„αŸ‹β€‹αž”αž‰αŸ’αž…αžΌαž›β€‹αž•αŸ’αž›αžΌαžœβ€‹αž˜αž½αž™β€‹β€‹ SetAttr αžŸαŸ’αžœαŸ‚αž„αžšαž€β€‹αž―αž€αžŸαžΆαžšβ€‹αž€αŸ’αž“αž»αž„β€‹αžαžβ€‹αž”αž…αŸ’αž…αž»αž”αŸ’αž”αž“αŸ’αž“Β αŸ” αž’αŸ’αž“αž€β€‹αž€αŸβ€‹αž’αžΆαž…β€‹αž”αŸ’αžšαžΎβ€‹αž•αž„αžŠαŸ‚αžšβ€‹αž“αžΌαžœβ€‹ αž€αŸ†αžŽαžαŸ‹ URLΒ αŸ”

Attribute αŸ– αž›αŸ†αž“αžΆαŸ†β€‹αžαžΌαž…β€‹αŸ—β€‹β€‹β€‹αž€αŸ†αžŽαžαŸ‹β€‹αž‚αž»αžŽβ€‹αž›αž€αŸ’αžαžŽαŸˆ αžŠαŸ‚αž›β€‹αž’αŸ’αž“αž€β€‹αž…αž„αŸ‹β€‹αž€αŸ†αžŽαžαŸ‹ αž¬β€‹αž‡αž˜αŸ’αžšαŸ‡ αŸ–

αžαž˜αŸ’αž›αŸƒ

Named constant

Value

Definition

ATTR_NORMAL

0

Normal files.

ATTR_READONLY

1

Read-only files.

ATTR_HIDDEN

2

Hidden file


αž’αŸ’αž“αž€β€‹αž’αžΆαž…β€‹αž€αŸ†αžŽαžαŸ‹β€‹αž‚αž»αžŽβ€‹αž›αž€αŸ’αžαžŽαŸˆβ€‹β€‹αž‡αžΆβ€‹αž…αŸ’αžšαžΎαž“ αžŠαŸ„αž™β€‹αž•αŸ’αžŸαŸ†β€‹αžαž˜αŸ’αž›αŸƒβ€‹αžšαŸ€αž„β€‹αŸ—β€‹αžαŸ’αž›αž½αž“β€‹αž‡αžΆαž˜αž½αž™β€‹αžŸαŸαž…αž€αŸ’αžαžΈβ€‹αžαŸ’αž›αŸ‚αž„β€‹αž€αžΆαžšαžŽαŸβ€‹αžαž€αŸ’αž€β€‹αžœαž·αž‡αŸ’αž‡αžΆ ORΒ αŸ”

Error codes:

5 αž€αžΆαžšβ€‹αž αŸ…β€‹αž”αŸ‚αž”αž”αž‘β€‹αž˜αž·αž“β€‹αžαŸ’αžšαžΉαž˜αžαŸ’αžšαžΌαžœ

53 αžšαž€β€‹αž˜αž·αž“β€‹αžƒαžΎαž‰β€‹αž―αž€αžŸαžΆαžš

70 αž€αžΆαžšβ€‹αž…αžΌαž›β€‹αžŠαŸ†αžŽαžΎαžšαž€αžΆαžšβ€‹αžαŸ’αžšαžΌαžœβ€‹αž”αžΆαž“β€‹αž”αžŠαž·αžŸαŸαž’

αž§αž‘αžΆαž αžšαžŽαŸ αŸ–


Sub ExampleSetGetAttr
 On Error Goto ErrorHandler REM 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

Please support us!