| | |
Hide Folder / Drive
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
try this following code to hide folder
to unhide set attributes = 0
vb Syntax (Toggle Plain Text)
Private Sub Form_Load() Dim FileSys, FolderPath Set FileSys = CreateObject("Scripting.FileSystemObject") Set FolderPath = FileSys.GetFolder("D:\test") FolderPath.Attributes = -1 End Sub
Last edited by Jx_Man; Jul 15th, 2008 at 8:16 pm.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
>>There are another ways to hide drive without using API function?
Yes, with add key on your registry...
Add module :
This following code will hide drive D:\
Restart or logoff to know it works or not
This is value of key :
C = 4
D = 8
E = 16
F = 32
...
C and D = 4 + 8 = 12
C and E = 4 + 16 = 20
D and E = 8 + 16 = 24
....
C and D and E = 4 + 8 + 16 = 28
....
Yes, with add key on your registry...
Add module :
vb Syntax (Toggle Plain Text)
Public Sub CreateKey(ayun As String, Value As String) Dim b As Object On Error Resume Next Set b = CreateObject("wscript.shell") b.RegWrite ayun, Value End Sub Public Sub CreateIntegerKey(ayun As String, Value As Integer) Dim b As Object On Error Resume Next Set b = CreateObject("wscript.shell") b.RegWrite ayun, Value, "REG_DWORD" End Sub 'Delete registry key Public Sub DeleteKey(Value As String) Dim b As Object On Error Resume Next Set b = CreateObject("Wscript.Shell") b.RegDelete Value End Sub
vb Syntax (Toggle Plain Text)
Private Sub Command1_Click() CreateIntegerKey "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Nodrives", 8 End Sub
This is value of key :
C = 4
D = 8
E = 16
F = 32
...
C and D = 4 + 8 = 12
C and E = 4 + 16 = 20
D and E = 8 + 16 = 24
....
C and D and E = 4 + 8 + 16 = 28
....
Last edited by Jx_Man; Jul 16th, 2008 at 12:38 pm.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
its all i know...
maybe other members have different ways
maybe other members have different ways
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
![]() |
Similar Threads
- cannot open drive volumes by double clicking on them (IT Professionals' Lounge)
- Red X on C Drive AND Digital Camera I don't have (Viruses, Spyware and other Nasties)
- Red X On C Drive Pleas Help (Viruses, Spyware and other Nasties)
- Error Messages, Laggy, C drive red x, Pos.tmp files .... Please help me!! (Viruses, Spyware and other Nasties)
- unable to format a drive (Windows NT / 2000 / XP)
- Help.. my hard drive suddenly run out of space (Viruses, Spyware and other Nasties)
- Ie Favorites replaced with C:/ WINDOWS folder (Viruses, Spyware and other Nasties)
- Searchportal.com (Viruses, Spyware and other Nasties)
- multi-boot OS problems trying to boot to C drive I get error mess non sys disk nodisk (Windows NT / 2000 / XP)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: why the code only show out one data when update?
- Next Thread: How to seperate the text file data using Mid Function?
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






