Solved

Turn of the Read-Only flag of a file.

Posted on 1998-06-19
1
158 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

689 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