Thread: What to programmatically hide a file

  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    7

    How to programmatically hide a file or folder

    I would like to know how to program a file or folder to be hidden but at the same time prevent the file or folder to be visible with the Show hidden files and folders option enabled.

    Any suggestions or comments would be appreciated

    Victor
    Last edited by victor43; 02-05-2010 at 04:04 PM.

  2. #2
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    Reason?
    Woop?

  3. #3
    Registered User
    Join Date
    Feb 2010
    Posts
    7
    Quote Originally Posted by prog-bman View Post
    Reason?
    I am facinated by stealth programs like keyloggers on how they do it. So I would like to write an application that can detect these hidden files first. I know there are other methods used by spyware to hide themselves so this is just a starting point for now.

    Hope that answers your questions.

    Victor

  4. #4
    Registered User NeonBlack's Avatar
    Join Date
    Nov 2007
    Posts
    431
    Operating system?
    I copied it from the last program in which I passed a parameter, which would have been pre-1989 I guess. - esbo

  5. #5
    Registered User
    Join Date
    Feb 2010
    Posts
    7
    Quote Originally Posted by NeonBlack View Post
    Operating system?
    Sorry forgot to add that I'm using Windows XP SP3. Victor.

  6. #6
    Registered User NeonBlack's Avatar
    Join Date
    Nov 2007
    Posts
    431
    Most peoples' settings will hide "system" files even when they are set to show "hidden" files and folders. So the simplest thing you could do would be to set the file attributes to system.
    You could do this with something like system("attrib +H +S <file>") or using the win32 api.
    I copied it from the last program in which I passed a parameter, which would have been pre-1989 I guess. - esbo

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 03:39 AM
  2. archive format
    By Nor in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 08-05-2003, 07:01 PM
  3. Making a LIB file from a DEF file for a DLL
    By JMPACS in forum C++ Programming
    Replies: 0
    Last Post: 08-02-2003, 08:19 PM
  4. Hmm....help me take a look at this: File Encryptor
    By heljy in forum C Programming
    Replies: 3
    Last Post: 03-23-2002, 10:57 AM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM