Hide a Folder

  • Thread starter Thread starter BobbyBob
  • Start date Start date
B

BobbyBob

Is it possible to alter the hidden attribute of a folder and if so how?
Thanks in advance.
 
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 <--
 
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
 
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 <--
.
 
Back
Top