943,819 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Jul 15th, 2008
1

Hide Folder / Drive

Expand Post »
Hi Masters...
I want to hide folder or drive with vb6, but i don't have idea how to do this.
any one know how to solved this?

Please Help.
Any suggestion will appreciated much.
Similar Threads
Reputation Points: 37
Solved Threads: 7
Junior Poster in Training
Estella is offline Offline
99 posts
since Jan 2008
Jul 15th, 2008
0

Re: Hide Folder / Drive

Do you use any control or what?

Where will other drives or folders be shown?

Little info little help.
Reputation Points: 10
Solved Threads: 6
Light Poster
Teropod is offline Offline
36 posts
since Jul 2008
Jul 15th, 2008
0

Re: Hide Folder / Drive

>> Do you use any control or what?
No, i don't.
I just wanna to hide or unhide drive or folder.
Ex : D:\test (Hide folder test on drive D)...
Any suggestion...
Reputation Points: 37
Solved Threads: 7
Junior Poster in Training
Estella is offline Offline
99 posts
since Jan 2008
Jul 15th, 2008
1

Re: Hide Folder / Drive

Using Api function to hide drive
Reputation Points: 38
Solved Threads: 6
Junior Poster in Training
Sawamura is offline Offline
65 posts
since Nov 2007
Jul 15th, 2008
1

Re: Hide Folder / Drive

try this following code to hide folder
vb Syntax (Toggle Plain Text)
  1. Private Sub Form_Load()
  2. Dim FileSys, FolderPath
  3. Set FileSys = CreateObject("Scripting.FileSystemObject")
  4. Set FolderPath = FileSys.GetFolder("D:\test")
  5. FolderPath.Attributes = -1
  6. End Sub
to unhide set attributes = 0
Last edited by Jx_Man; Jul 15th, 2008 at 8:16 pm.
Reputation Points: 1182
Solved Threads: 392
Posting Sensei
Jx_Man is offline Offline
3,140 posts
since Nov 2007
Jul 16th, 2008
0

Re: Hide Folder / Drive

Thx Jx_man, your code worked nice.
one problem again, how to hide drive?
there are another ways to hide drive without using API function?

Any suggestion...
Reputation Points: 37
Solved Threads: 7
Junior Poster in Training
Estella is offline Offline
99 posts
since Jan 2008
Jul 16th, 2008
2

Re: Hide Folder / Drive

>>There are another ways to hide drive without using API function?
Yes, with add key on your registry...
Add module :
vb Syntax (Toggle Plain Text)
  1. Public Sub CreateKey(ayun As String, Value As String)
  2. Dim b As Object
  3. On Error Resume Next
  4. Set b = CreateObject("wscript.shell")
  5. b.RegWrite ayun, Value
  6. End Sub
  7.  
  8. Public Sub CreateIntegerKey(ayun As String, Value As Integer)
  9. Dim b As Object
  10. On Error Resume Next
  11. Set b = CreateObject("wscript.shell")
  12. b.RegWrite ayun, Value, "REG_DWORD"
  13.  
  14. End Sub
  15. 'Delete registry key
  16. Public Sub DeleteKey(Value As String)
  17. Dim b As Object
  18. On Error Resume Next
  19. Set b = CreateObject("Wscript.Shell")
  20. b.RegDelete Value
  21. End Sub
This following code will hide drive D:\
vb Syntax (Toggle Plain Text)
  1. Private Sub Command1_Click()
  2. CreateIntegerKey "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Nodrives", 8
  3. End Sub
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
....
Last edited by Jx_Man; Jul 16th, 2008 at 12:38 pm.
Reputation Points: 1182
Solved Threads: 392
Posting Sensei
Jx_Man is offline Offline
3,140 posts
since Nov 2007
Jul 16th, 2008
0

Re: Hide Folder / Drive

wow, thank you Jx_Man.
It worked, but i must logoff or restart to see the result of hiding drive.

There are anyone know another way to hide without logoff or restart computer.
Reputation Points: 37
Solved Threads: 7
Junior Poster in Training
Estella is offline Offline
99 posts
since Jan 2008
Jul 19th, 2008
0

Re: Hide Folder / Drive

its all i know...
maybe other members have different ways
Reputation Points: 1182
Solved Threads: 392
Posting Sensei
Jx_Man is offline Offline
3,140 posts
since Nov 2007
Jul 24th, 2008
0

Re: Hide Folder / Drive

how i unhide my drive. now my drive d is hide. so please help me
Reputation Points: 14
Solved Threads: 78
Practically a Posting Shark
abu taher is offline Offline
835 posts
since Jul 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Error when calling exe from VB and waiting for the exe to finish
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Vb6 Update Query





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC