Announcement

Collapse
No announcement yet.

Script to hide G: drive from user.

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Script to hide G: drive from user.

    In my previous plea for help, I needed a script to shuffle some mapped drives around. REMS meet that challenge marvelously.
    http://forums.petri.com/showthread.php?t=19170

    My next course of action was to create a GPO setting to hide the G: drive so curious users aren't compelled to go exploring and possibly do damage to data. For those who ask "why map the drive then?" Well, my app needs RWM control.

    My question now is, can a script be created to hide the G: drive? This comes down to my lack of creativity. I can't think of how (or don't know) to do this outside of GPO. Thanks again in advance.

  • #2
    Re: Script to hide G: drive from user.

    As far as I know, this is only possible to hide local drive's

    The two things you can give a try to protect a mapped drive letter:

    1)
    Renaming the drive, this will hide the UNC path:
    Code:
    appDrive = "G:"
    sAlias = ""   'or, you can add here the text "Access denied"
    
    CreateObject("Shell.Application").NameSpace(appDrive).Self.Name = sAlias
    2)
    If possible create subfolders in the share.
    1. Create a subfolder
    2. Set the NTFS security in the mapped folder to domain\Users DENY-'List folder content'. But do not! pass this security to subfolders.

    Now you can acces G:\subfolder but not G:. So if the users don't know the existence of the subfolder, they cannot browse G:


    \Rems
    Last edited by Rems; 24th October 2007, 18:06. Reason: changed the Help url

    This posting is provided "AS IS" with no warranties, and confers no rights.

    __________________

    ** Remember to give credit where credit's due **
    and leave Reputation Points for meaningful posts

    Comment


    • #3
      Re: Script to hide G: drive from user.

      It is me again

      I tried the registry thing, added "NoDrives" Dword entry with value 64 to the registrykey:
      HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Policies\Explorer
      Then Stopped and started the explorer.exe process.

      Now the mapped drive G: actually was disappeared But also was drive C: ???
      In my case G: was mapped to a local folder on a drive D:.
      Code:
      ' http://www.wisdombay.com/hidedrive/index.php
      
      Set objShell = Wscript.CreateObject("Wscript.shell")
      key =  "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"
      sEntry = "NoDrives"
      sData = 100  '=dec, eq to hex 64
      sVType = "REG_DWORD"
      objShell.RegWrite key & "\" & sEntry, sData, sVType
      But if you go for G: in the the brower addressbar it will show everything again.
      I would rename the drivename anyway.


      \Rems



      UPDATE:
      http://forums.petri.com/showthread.php?t=25948

      .
      Last edited by Rems; 30th July 2008, 01:31.

      This posting is provided "AS IS" with no warranties, and confers no rights.

      __________________

      ** Remember to give credit where credit's due **
      and leave Reputation Points for meaningful posts

      Comment

      Working...
      X