mrwoberts Posted February 1, 2014 Posted February 1, 2014 30 laptops, shared between Year 1 and Year 2 classes (Infant School) Laptops not on a domain - a project for another time. When the laptop is switched on it logs straight into a standard pupil user profile and Maps the root of the Children's shared drive (NAS). This all works fine and the laptops are pretty stable. The only concern at the moment is the children are struggling to carefully navigate to their Class folder, then into a 'topic' folder... e.g. The sometimes end up 'accidentally' moving an entire folder into another one, which is hilarious the first time it happens, but then it gets a little tiring - The Mystery of the Missing Folder. Apple Class Banana Class Pear Class |_____ Animation Strawberry Class I thought of creating a BATCH file at logon to prompt for the class they belong to, and map that particular shared folder... It would be nicer as a GUI if anyone has done something like this before (like RM Class Selector) Your thoughts/help would be much appreciated.
sted Posted February 1, 2014 Posted February 1, 2014 http://www.edugeek.net/forums/how-do-you-do/128694-i-need-vb-script-map-drive.html have a look at the last post 1
mrwoberts Posted February 1, 2014 Author Posted February 1, 2014 Thanks sted, I like command line scripts. I've been trawling the net and adapted a solution I found here. Created a new text file with name MapHomeDrive.HTA Map drive M: to Class Folder ApplicationName="MapClassFolder.HTA" SingleInstance="Yes" WindowsState="Normal" Scroll="No" Navigable="No" MaximizeButton="No" SysMenu="No" Caption="No" > <br /> <br /> Option Explicit<br /> Dim objNetwork, objShell<br /> Dim strMapDriveLetter, strMapDrivePath, bPersistent<br /> <br /> Set objNetwork = CreateObject("WScript.Network")<br /> Set objShell = CreateObject("Shell.Application")<br /> strMapDriveLetter = "M:"<br /> bPersistent = False<br /> <br /> Sub Window_onLoad<br /> window.resizeTo 400, 175<br /> window.moveTo 400, 300<br /> End Sub<br /> <br /> <br /> Sub MapDrive(strClassName)<br /> on Error Resume Next<br /> <br /> 'Create full path using Class name<br /> strMapDrivePath = "\\NAS\" & strClassName<br /> <br /> 'Disconnect current M drive<br /> Call DisconnectDrive()<br /> <br /> 'Map drive and alias<br /> objNetwork.MapNetworkDrive strMapDriveLetter, strMapDrivePath, bPersistent<br /> objShell.NameSpace(strMapDriveLetter).Self.Name = "Home"<br /> <br /> CloseScript()<br /> End Sub<br /> <br /> <br /> Sub CloseScript<br /> Set objShell = Nothing<br /> Set objNetwork = Nothing<br /> Self.Close()<br /> End Sub<br /> <br /> <br /> Sub DisconnectDrive<br /> on Error Resume Next<br /> objNetwork.RemoveNetworkDrive strMapDriveLetter, True, True<br /> End Sub<br /> <br /> Choose your Class 1
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