Script to hide G: drive from user.

Home Forums Scripting General Scripting Script to hide G: drive from user.

This topic contains 2 replies, has 2 voices, and was last updated by Rems Rems 12 years, 1 month ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • CaTBuS
    CaTBuS
    Participant
    #128439

    In my previous plea for help, I needed a script to shuffle some mapped drives around. REMS meet that challenge marvelously.
    th36_1_32.gif 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.

    Rems
    Rems
    Moderator
    #226574

    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:
    appDrive = “G:”
    sAlias = “” ‘or, you can add here the text “Access denied”

    CreateObject(“Shell.Application”).NameSpace(appDrive).Self.Name = sAlias[/CODE]

    2)
    If possible create subfolders in the share.
    [LIST=1]
    [*]Create a subfolder
    [*]Set the NTFS security in the mapped folder to domainUsers DENY-‘List folder content’. But do not! pass this security to subfolders.
    [/LIST]
    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[CODE]appDrive = “G:”
    sAlias = “” ‘or, you can add here the text “Access denied”

    CreateObject(“Shell.Application”).NameSpace(appDrive).Self.Name = sAlias[/CODE]

    2)
    If possible create subfolders in the share.

    1. Create a subfolder
    2. Set the NTFS security in the mapped folder to domainUsers 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

    Rems
    Rems
    Moderator
    #226576

    Re: Script to hide G: drive from user.

    It is me again :shock:

    I tried the registry thing, added “NoDrives” Dword entry with value 64 to the registrykey:
    HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurre ntVersionPoliciesExplorer
    Then Stopped and started the explorer.exe process.

    Now the mapped drive G: actually was disappeared But also was drive C: :cry: ???
    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_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer”
    sEntry = “NoDrives”
    sData = 100 ‘[url=http://www.statman.info/conversions/hexadecimal.html]=dec, eq to hex [B]64[/B][/url]
    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

    .

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.