Y
YXQ
How to create hidden property directory using Directory.CreateDirectory?
Thank you
Thank you
How to create hidden property directory using Directory.CreateDirectory?
Thank you
Thank you, but how to know the folder has been created successfully? my code
below will not work, thank you
////////////////////////////////////////////////////////////////
Dim dir As New System.IO.DirectoryInfo("m:\myhidden")
dir.Create()
dir.Attributes = IO.FileAttributes.Hidden
' Create folder
Do Until dir.Attributes = IO.FileAttributes.Hidden
Application.DoEvents()
Loop
///////////////////////////////////////////////////////////
Onur Güzel said:Calling dir.Create method will create folder, then you're ready to set
its attirbute as Hidden. If you want to check whether operation is
successful, you can use the code in a Try-Catch block and handling
exceptions in Catch block. However, i'm not fully sure what you want,
if you're referring to an existing directory to make it hidden, remove
Create method just use:
Dim dir As New System.IO.DirectoryInfo("c:\myhidden")
dir.Attributes = IO.FileAttributes.Hidden
Plus, it depends on what you want to achieve exaclty, for instance, to
make all files hidden inside that directory you must use FileInfo
class in a loop by iterating.
Onur Güzel