Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create invisible folder?

Status
Not open for further replies.

Wolf67

Programmer
Mar 18, 2005
11
SE
I have a problem! I want to create a folder in Windows xp with VB 6, and i want that folder to be invisible (even if i have marked "Show hidden folders" in control panel). But thats not enough, Ii want the application thats created the invisible folder have access to the invisible folder.

Could this be done? And if so could any one help me or point me in the right direction.
 
Can we start with a quick explanation from you about why you want/need to do this?
 
Do you work for Sony? :)

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
I have an application that uses encrypted html files and when i decrypted the files i don´t want to shew the content in the files. It´s rather difficult to explain it, but it´s no suspect thing
 
Fine. And can you guarantee that the file system will be NTFS?
 
Well ... if you were using NTFS then we could take advantage of a feature called Alternative Data Streams (ADS)

Here's a simple example (showing that both the classical file handling techniques and FSO know about ADS). After running this procedure, have a look at the file that has been created (both its properties and contents) ...
Code:
[blue]Public Sub ADSDemo()
    Dim hFile As Long
   
    hFile = FreeFile
    Open "C:\adsdemo.txt:adshidden.txt" For Output As hFile
    Print #hFile, "A very simple example of a file hidden in an alternative data stream"
    Close hFile
     
    MsgBox CreateObject("scripting.filesystemobject").OpenTextFile("C:\adsdemo.txt:adshidden.txt").ReadAll
End Sub[/blue]
 
Very interesting, strongm.

For those interested, I found plenty of information on ADS on the web. I found to have some particularly interesting information on security issues.

I'm curious to know, strongm, what happens to the ADS data when you delete the tag file. For example, if you're trying to clean a text file of any ADS associated with it, and do the following:
Code:
type myfile.txt > temp
del myfile.txt
ren temp myfile.txt
Do we know for sure that we have deleted the ADS, to the extent that we can be certain that we have removed, say, a malicious exe file?

Bob
 
:) Something like a flag bit in the ntfs equivalent of the fat that says that a given byte is part of an ads associated with the tag file, then?
 
At a low level NTFS knows that files are made up of (perhaps many) streams. Delete default stream (the data stream) and NTFS cleans up all other streams associated with it.

The streams are only hidden from us because a number of the tools that MS provide for navigating the filing system are not stream-aware, they are not hidden from NTFS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top