Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I change file atributes in run?

Status
Not open for further replies.

bon011

Programmer
Jun 2, 2002
155
CZ
How can I change file atributes in run?
Is it possible?
 
bon011 (Programmer)

You could change the file atributes.
Go to thread184-576860 you will find the answer

As I go deeper the road seems to go further. We're just simply pasangers on the road of knowledge.
 
Bon011,

Another way of doing this is with the Windows Scripting Host:

oFS = CREATEOBJECT("Scripting.FileSystemObject")
oFile = OFS.GetFile("myfile.doc")
oFile.Attributes = BITOR(oFile.Attributes,1)

The above code will set the ReadOnly attribute. Other values for the second parameter of BITOR will set other attributes. Or use BITAND to clear the attributes.

Let me know if you need more information about this.

Mike


Mike Lewis
Edinburgh, Scotland
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top