Jump to content

How Can I Hide any Drive?


Hina
 Share

Recommended Posts

I want to hide the D-Drive of my PC from my kids by using Autoit so that It won't appear to anyone. By using which command of autoit I can do that??If U can help then it will be much appreciated
Link to comment
Share on other sites

I want to hide the D-Drive of my PC from my kids by using Autoit so that It won't appear to anyone. By using which command of autoit I can do that??If U can help then it will be much appreciated

Registry

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

NoDrives = ... (0 - All Show, 1 - "A", 2 - "B", 4 - "C", 8 - "D", (1 + 8) - "A" and "D", etc)

*Requires restart

AutoIt

RegRead(), RegWrite(), Shutdown(2)

:D

Link to comment
Share on other sites

  • 1 month later...

I wanna try on this. I know its easy ok.

If you want to hide FIXED drive only, i think this should be work.

$list = DriveGetDrive("FIXED")
If Not @error Then
MsgBox(4096,"", "Found " & $list[0] & " drives")
       For $i = 1 To $list[0]
        $drvname = StringLeft($list[$i], 1)
        Switch $drvname
            Case "c"
                RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoDrives", "REG_DWORD", "4")
            Case "d"
                RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoDrives", "REG_DWORD", "8")
            Case "e"
                RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoDrives", "REG_DWORD", "16")
            Case "f"
                RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoDrives", "REG_DWORD", "32")
            Case "g"
                RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoDrives", "REG_DWORD", "64")
            Case "h"
                RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoDrives", "REG_DWORD", "128")
            Case "i"
                RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoDrives", "REG_DWORD", "256")
        EndSwitch
    Next
EndIf
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...