3 Replies - 28139 Views - Last Post: 22 October 2010 - 04:31 AM Rate Topic: -----

#1 guyfromri   User is offline

  • D.I.C Addict

Reputation: 46
  • View blog
  • Posts: 836
  • Joined: 16-September 09

Setting the properties of a file

Posted 21 October 2010 - 11:40 PM

Hello again everyone!!


So, I have a dilema..and of course...who else would I turn to for help?


I have a program that creates a data file. It's used by a number of people and if a file is created with data that's considered "Sensitive" then all kinds of issues can arrise.

I'm curious about setting the file properties...I know there has to be a way to do it...I'm just not sure what that way is...I googled it and didn't come up with much....

THERE IS NO MALICIOUS INTENT HERE....I think you all know me well enough to guess that but I wanted it to be clear.

Does anyone know of a command or have a link that I can check out to start putting the pieces together on this?


As always, thanks in advance!!!!

Is This A Good Question/Topic? 0
  • +

Replies To: Setting the properties of a file

#2 maj3091   User is offline

  • D.I.C Lover
  • member icon

Reputation: 331
  • View blog
  • Posts: 2,004
  • Joined: 26-March 09

Re: Setting the properties of a file

Posted 22 October 2010 - 01:14 AM

There are two API's that can be used, aptly called GetFileAttributes and SetFileAttributes.

Might be worth a look. :)
Was This Post Helpful? 0
  • +
  • -

#3 Nikhil_07n   User is offline

  • The cheese stands alone..
  • member icon

Reputation: 54
  • View blog
  • Posts: 2,490
  • Joined: 09-January 09

Re: Setting the properties of a file

Posted 22 October 2010 - 04:04 AM

Alternatively, you can use Shell + cmd + attrib command.

Like this:

Shell("cmd /c attrib E:\nik.txt +h")


Quote

Displays or changes file attributes.

ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H] [+I | -I]
[drive:][path][filename] [/S [/D] [/L]]

+ Sets an attribute.
- Clears an attribute.
R Read-only file attribute.
A Archive file attribute.
S System file attribute.
H Hidden file attribute.
I Not content indexed file attribute.
[drive:][path][filename]
Specifies a file or files for attrib to process.
/S Processes matching files in the current folder
and all subfolders.
/D Processes folders as well.
/L Work on the attributes of the Symbolic Link versus
the target of the Symbolic Link

Was This Post Helpful? 0
  • +
  • -

#4 raziel_   User is offline

  • Like a lollipop
  • member icon

Reputation: 469
  • View blog
  • Posts: 4,280
  • Joined: 25-March 09

Re: Setting the properties of a file

Posted 22 October 2010 - 04:31 AM

and you can use the FSO for this too an example:
http://www.dreaminco...9-folder-hider/
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1