Hide a Folder

B

BobbyBob

Is it possible to alter the hidden attribute of a folder and if so how?
Thanks in advance.
 
S

Stefan Hoffmann

hi Bobby,

Is it possible to alter the hidden attribute of a folder and if so how?
Use the FileSystemObject to get a folder and change its attributes:

http://msdn.microsoft.com/en-us/library/hww8txat(VS.85).aspx
http://msdn.microsoft.com/en-us/library/f1xtf7ta(VS.85).aspx
http://msdn.microsoft.com/en-us/library/5tx15443(VS.85).aspx

Either use late binding

Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")

or early binding (set a reference to the MS Scripting runtime)

Dim fso As Scripting.FileSystemObject
Set fso = new Scripting.FileSystemObject



mfG
--> stefan <--
 
S

Stuart McCall

BobbyBob said:
Is it possible to alter the hidden attribute of a folder and if so how?
Thanks in advance.

To hide the c:\temp folder:

SetAttr "c:\temp", vbHidden

and to unhide it:

SetAttr "c:\temp", vbNormal
 
B

BobbyBob

Thank you

Stefan Hoffmann said:
hi Bobby,


Use the FileSystemObject to get a folder and change its attributes:

http://msdn.microsoft.com/en-us/library/hww8txat(VS.85).aspx
http://msdn.microsoft.com/en-us/library/f1xtf7ta(VS.85).aspx
http://msdn.microsoft.com/en-us/library/5tx15443(VS.85).aspx

Either use late binding

Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")

or early binding (set a reference to the MS Scripting runtime)

Dim fso As Scripting.FileSystemObject
Set fso = new Scripting.FileSystemObject



mfG
--> stefan <--
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top