Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Windows File Attributes

Author
Message
Dc GameMaker
20
Years of Service
User Offline
Joined: 24th Oct 2003
Location: Somewhere in the midsts of Canada
Posted: 29th Apr 2004 05:26
Does anyone know how I can design a program that changes the attributes on Windows files? eg Read Only, Archive, and Hidden.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 29th Apr 2004 16:09
I don't think you can in dbp, but I will look at adding it to our dll


Home of the VB.NET Class Builder Utility - Demo and FULL versions now available!!
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 29th Apr 2004 17:48
UPDATE:

Ok I just added 2 functions to our soon-to-be-released dll

fil_GetAttrib() : returns a single comma separated string listing the current file attributes

fil_SetAttrib() : allows the user to set the specified file to any valid file attribute and/or combination thereof.


Home of the VB.NET Class Builder Utility - Demo and FULL versions now available!!
Mussi
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 29th Apr 2004 20:27
you could do it using the attrib dos command and the execute file command



Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 29th Apr 2004 23:52 Edited at: 29th Apr 2004 23:54
Here is are a couple of funtions that allow you to add or remove attributes of a file. Using the api.
See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/setfileattributes.asp
http://www.mentalis.org/apilist/GetFileAttributes.shtml
for details

rem_attrib() removes attributes from a file and add_attrib() adds them.

See source button at bottom of post for source.

i won't see you in the pit

Login to post a reply

Server time is: 2024-09-22 07:30:58
Your offset time is: 2024-09-22 07:30:58