Solved

Turn of the Read-Only flag of a file.

Posted on 1998-06-19
1
153 Views
Last Modified: 2010-04-04
Help
How can I change the "attrib" of a file? For example: I want to turn off the "read-only"-flag of LOGOW.SYS in my Windows-directory.
Thanx.
RoosieDB.
0
Comment
Question by:roosiedb
1 Comment
 

Accepted Solution

by:
edmoore earned 30 total points
ID: 1354406
You can use FileSetAttr(filename :string, attributes :TFileAttributes)

For example, to make logow.sys just a normal file, you would do:

FileSetAttr('c:\windows\logow.sys', 0);

And then to turn it back to normal, this:

FileSetAttr('c:\windows\logow.sys', faHidden or faReadOnly or faArchive);

Note:  the OR flags combine parameters, so the file is set to hidden, readonly and archive.  To find any more information, search for FileSetAttr in win32.hlp, but I think this should be OK - works for me!

Regards,

Ed Moore
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now