Chuckster Posted August 21, 2008 Posted August 21, 2008 Using this example from the Wiki page: On Error Resume next Dim WshNetwork Set WshNetwork = WScript.CreateObject("WScript.Network") Set objSysInfo = CreateObject("ADSystemInfo") Set objNetwork = CreateObject("Wscript.Network") strUserPath = "LDAP://" & objSysInfo.UserName Set objUser = GetObject(strUserPath) WshNetwork.RemoveNetworkDrive "H:" WshNetwork.RemoveNetworkDrive "I:" WshNetwork.RemoveNetworkDrive "J:" WshNetwork.RemoveNetworkDrive "K:" WshNetwork.RemoveNetworkDrive "L:" WshNetwork.RemoveNetworkDrive "M:" WshNetwork.RemoveNetworkDrive "O:" WshNetwork.RemoveNetworkDrive "P:" WshNetwork.RemoveNetworkDrive "Q:" WshNetwork.RemoveNetworkDrive "R:" WshNetwork.RemoveNetworkDrive "S:" WshNetwork.RemoveNetworkDrive "T:" WshNetwork.RemoveNetworkDrive "U:" WshNetwork.RemoveNetworkDrive "V:" WshNetwork.RemoveNetworkDrive "W:" WshNetwork.RemoveNetworkDrive "X:" WshNetwork.RemoveNetworkDrive "Y:" WshNetwork.RemoveNetworkDrive "Z:" For Each strGroup in objUser.MemberOf strGroupPath = "LDAP://" & strGroup Set objGroup = GetObject(strGroupPath) strGroupName = objGroup.CN Select Case strGroupName Case "AD GROUP NAME1" objNetwork.MapNetworkDrive "S:", "\\server\share$" Case "AD GROUP NAME2" objNetwork.MapNetworkDrive "T:", "\\server\share$" End Select Next How would one map a network drive so that it remains hidden but still accessbible except from My Computer. Any ideas?
FN-GM Posted August 21, 2008 Posted August 21, 2008 (edited) This will do the job, this is what we use. Using Group Policy Objects to hide specified drives Instead of using all that VBS code you can use a batch file net use * /d /y net use s: "\\sevrer\share" net use t: "\\server\share" or instead of using all that code to disconnect all those drives you can use this VBS code, providing your home drive letter is T, you can alter it though ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: '::: Disconnect network drives left from previous login ::: ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: on error resume next Set objNetwork = CreateObject("Wscript.Network") For intLoop = Asc ("A:") To Asc ("s:") objNetwork.RemoveNetworkDrive Chr (intLoop) & ":", TRUE, TRUE Next For intLoop = Asc ("U:") To Asc ("Z:") objNetwork.RemoveNetworkDrive Chr (intLoop) & ":", TRUE, TRUE Next Wscript.Quit for you it will go ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: '::: Disconnect network drives left from previous login ::: ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: on error resume next Set objNetwork = CreateObject("Wscript.Network") For intLoop = Asc ("H:") To Asc ("Z:") objNetwork.RemoveNetworkDrive Chr (intLoop) & ":", TRUE, TRUE Next Wscript.Quit You will need to take out Wscript.Quit if you are putting it into another script. Edited August 21, 2008 by FN-Greatermanchester Error in VBS
Chuckster Posted August 21, 2008 Author Posted August 21, 2008 Ooo, that's an interesting one. I will save that for later use. However, what I was after was to map a network, e.g. K: and have it hidden, i.e. not viewable in My Computer or any other place. But can be accessed, say, from MS Word --> File --> Open and the corresponding drive letter typed in to show you what's on there. The reason why I want it this way is to give Google Earth a place to write its cache files and whatnot rather than on the C drive of every computer. Also, I don't want people to be able to view the files but can write to it. I hope that makes sense.
FN-GM Posted August 21, 2008 Posted August 21, 2008 the link in my previous post will allow this - Using Group Policy Objects to hide specified drives We use this to hide the sims drive. z
Chuckster Posted August 21, 2008 Author Posted August 21, 2008 the link in my previous post will allow this - Using Group Policy Objects to hide specified drives We use this to hide the sims drive. z It seems like I would need to create my own binary numerical values. What would the binary number be for drive letters E, which is our SIMS drive, and drive letter Z, which is going to be where Google Earth can write to?
FN-GM Posted August 21, 2008 Posted August 21, 2008 (edited) i Think it is 1100100 Edited August 21, 2008 by FN-Greatermanchester
box_l Posted August 21, 2008 Posted August 21, 2008 (edited) Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer] "NoDrives"=dword:00800000 this hides my X: drive this page will give you the values Hide Drives in My Computer at Registry Guide for Windows E: 16 + Z: 33554432 = 33554448 = (n hex) 2000010 BoX Edited August 21, 2008 by box_l
originofsymmetry Posted August 21, 2008 Posted August 21, 2008 I use Hidecalc: HideCalc - A Tool for Hiding Drive Creates a custom .ADM Template with the drives you request hidden. When using it however, remove any of the standard windows group policies for hiding drives as confusion occurs.
FN-GM Posted August 21, 2008 Posted August 21, 2008 Just to add i don't think any of those methods work for vista.
originofsymmetry Posted August 21, 2008 Posted August 21, 2008 Just to add i don't think any of those methods work for vista. I've tried Hidecalc on Vista and it worked fine
FN-GM Posted August 21, 2008 Posted August 21, 2008 ah right thats good then. This is another nice little feature server 2008 has, makes life much more simple
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now