2

I want to write an excel macro that deletes/creates files and folders. This brought me to ask myself the following question:

How are hidden files/folders seen by programs and are they modifiable?

Points I wish to cover:

Which programs (if not all, or none) can access files and folders that are set to hidden?

Is it dangerous to let an intern work with file/folder deletion through VBA programming (assuming some hidden files may not be backed up)?

Can they mess up the computer MORE if in the folder options, hidden files and folders are shown (or does that do nothing different) and if protected OS files are not hidden as well?

5
  • Hidden files have no special delete permissions set to them by themselves. Being hidden won't make any difference in programming, other than the fact that you have to call them out individually. What I mean by that is you have to set the folder type when looping through. I have made programs doing similar tasks you are talking about
    – Eric F
    Aug 19, 2015 at 20:49
  • It is always dangerous when working on a new program and bug testing on data that hasn't been backed up.
    – Eric F
    Aug 19, 2015 at 20:50
  • If I write a program to loop through all files in a directory, it will pick up hidden files as well?
    – David G
    Aug 19, 2015 at 20:50
  • You have to "tell" it to look for hidden files. Here is an example: msdn.microsoft.com/en-us/library/7b748c15(v=vs.90).aspx
    – Eric F
    Aug 19, 2015 at 20:52
  • Ah ok. So maliciously it is extremely easy, but it can be avoided by checking that property. Thanks! I'll accept if you answer that.
    – David G
    Aug 19, 2015 at 20:54

1 Answer 1

1

In programming you can specify which file type you are searching for using the attributes of that file.

Here is a good example: https://msdn.microsoft.com/en-us/library/7b748c15(v=vs.90).aspx

You will simply look for files that match your desired file type (not hidden).

Do keep in mind that your method of deleting will more than likely be recursive as commands such as KILL(filepath) won't work since these are strictly for ALL files in a directory. I am answering based on how you state VBA in your question.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .