Solved

Turn of the Read-Only flag of a file.

Posted on 1998-06-19
1
152 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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

743 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

14 Experts available now in Live!

Get 1:1 Help Now