User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 403,516 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,867 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 678 | Replies: 10 | Solved
Reply
Join Date: Jan 2008
Location: Jogjakarta
Posts: 96
Reputation: Estella is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 6
Estella's Avatar
Estella Estella is offline Offline
Junior Poster in Training

Hide Folder / Drive

  #1  
Jul 15th, 2008
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.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2008
Posts: 31
Reputation: Teropod is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 6
Teropod Teropod is offline Offline
Light Poster

Re: Hide Folder / Drive

  #2  
Jul 15th, 2008
Do you use any control or what?

Where will other drives or folders be shown?

Little info little help.
Reply With Quote  
Join Date: Jan 2008
Location: Jogjakarta
Posts: 96
Reputation: Estella is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 6
Estella's Avatar
Estella Estella is offline Offline
Junior Poster in Training

Re: Hide Folder / Drive

  #3  
Jul 15th, 2008
>> 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...
Reply With Quote  
Join Date: Nov 2007
Posts: 63
Reputation: Sawamura is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 6
Sawamura's Avatar
Sawamura Sawamura is offline Offline
Junior Poster in Training

Re: Hide Folder / Drive

  #4  
Jul 15th, 2008
Using Api function to hide drive
Reply With Quote  
Join Date: Nov 2007
Location: ★ Jogja ★
Posts: 2,477
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Rep Power: 9
Solved Threads: 215
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Nearly a Posting Maven

Re: Hide Folder / Drive

  #5  
Jul 15th, 2008
try this following code to hide folder
  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 7:16 pm.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote  
Join Date: Jan 2008
Location: Jogjakarta
Posts: 96
Reputation: Estella is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 6
Estella's Avatar
Estella Estella is offline Offline
Junior Poster in Training

Re: Hide Folder / Drive

  #6  
Jul 16th, 2008
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...
Reply With Quote  
Join Date: Nov 2007
Location: ★ Jogja ★
Posts: 2,477
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Rep Power: 9
Solved Threads: 215
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Nearly a Posting Maven

Re: Hide Folder / Drive

  #7  
Jul 16th, 2008
>>There are another ways to hide drive without using API function?
Yes, with add key on your registry...
Add module :
  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:\
  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 11:38 am.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote  
Join Date: Jan 2008
Location: Jogjakarta
Posts: 96
Reputation: Estella is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 6
Estella's Avatar
Estella Estella is offline Offline
Junior Poster in Training

Re: Hide Folder / Drive

  #8  
Jul 16th, 2008
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.
Reply With Quote  
Join Date: Nov 2007
Location: ★ Jogja ★
Posts: 2,477
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Rep Power: 9
Solved Threads: 215
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Nearly a Posting Maven

Re: Hide Folder / Drive

  #9  
Jul 19th, 2008
its all i know...
maybe other members have different ways
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote  
Join Date: Jul 2008
Location: Dhaka, Bangladesh
Posts: 37
Reputation: abu taher is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
abu taher abu taher is offline Offline
Light Poster

Re: Hide Folder / Drive

  #10  
Jul 24th, 2008
how i unhide my drive. now my drive d is hide. so please help me
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 1:04 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC