?
Solved

Turn of the Read-Only flag of a file.

Posted on 1998-06-19
1
Medium Priority
?
159 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 120 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month13 days, 18 hours left to enroll

801 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