brian873 Posted January 21, 2005 Share Posted January 21, 2005 Does anyone know the registry settings that would allow you to right click and map a network drive to your current folder in explorer ? The same way as you can “open command prompt here”Hail Hail Link to comment Share on other sites More sharing options...
mattofak Posted January 21, 2005 Share Posted January 21, 2005 well, i dont know the exact reg keys you would add, and im too lazy to analyze the 'open command prompt here' code...however, you're welcome to do it, the string you would want as a command would be"net.exe" use \\computername\sharename\[\code] Link to comment Share on other sites More sharing options...
brian873 Posted January 21, 2005 Author Share Posted January 21, 2005 Thanks mattofak:But i would want it to map to the place i right clicked to so there was no hard coding.Here is what I have so farRegistry :Windows Registry Editor Version 5.00 ;----- Get a new Right-click menu option (command box)[HKEY_CLASSES_ROOT\Directory\shell\Map Drive Here]@="Map N&et Drive Here"[HKEY_CLASSES_ROOT\Directory\shell\Map Drive Here\command]@="Net use *"This adds the right click option, I am thinking I may need to do a batch file to map the drive. I dont know how to pass the current folder through the NET commandhail hail Link to comment Share on other sites More sharing options...
mattofak Posted January 21, 2005 Share Posted January 21, 2005 im working on a script for it... because the problem is, what drive is free... so you need to ask the user...thus, you need a message box which are not available in batch files... Link to comment Share on other sites More sharing options...
mattofak Posted January 21, 2005 Share Posted January 21, 2005 well, i've got the script to work, i just cannot get the registry to send it the UNC path, this requires more investigation...if you can work it out, heres the .REG file im using and attached is the script...REGEDIT4 [HKEY_CLASSES_ROOT\Folder\shell\NetMapHere] @="Map Network Drive Here" [HKEY_CLASSES_ROOT\Folder\shell\NetMapHere\command] @="C:\\Windows\\System32\\MakeNewNetDrive.vbs "%L""MakeNewNetDrive.vbs Link to comment Share on other sites More sharing options...
brian873 Posted January 21, 2005 Author Share Posted January 21, 2005 mattofak: looks good....i am doing the same through batch commands but i'm finding it hard to get the remote comuter name in to my NET USE command.come on all you smart guys get thinking !hail hail Link to comment Share on other sites More sharing options...
mattofak Posted January 21, 2005 Share Posted January 21, 2005 pass the name of the remote computer through to the batch file useing %1 at the end of the reg key, and then in the batch file:net use [driveletter] %1 Link to comment Share on other sites More sharing options...
brian873 Posted January 21, 2005 Author Share Posted January 21, 2005 mattofak,Getting there i think. The registry below will map to another windows machine with the right click. The draw back is you need to use the DELETE net drive option when you want the I: mapped to another location. For some reason it does not overwrite the settig with the new settings.Windows Registry Editor Version 5.00 ;----- Get a new Right-click menu option (command box)[HKEY_CLASSES_ROOT\Directory\shell\Map Drive Here]@="Map Net Drive Here"[HKEY_CLASSES_ROOT\Directory\shell\Map Drive Here\command]@="net use I: %1"[HKEY_CLASSES_ROOT\Directory\shell\Map Drive DELETE]@="DELETE Net Drive"[HKEY_CLASSES_ROOT\Directory\shell\Map Drive DELETE\command]@="net use I: /delete /y" Link to comment Share on other sites More sharing options...
mattofak Posted January 21, 2005 Share Posted January 21, 2005 well, that looks good, but if you want to use a script based approach, i finally got mine to work!Add the reg keys to your registry:REGEDIT4 [HKEY_CLASSES_ROOT\Folder\shell\NetMapHere] @="Map Network Drive Here" [HKEY_CLASSES_ROOT\Folder\shell\NetMapHere\command] @="WScript.exe C:\\Windows\\System32\\MakeNewNetDrive.vbs "%L""Place the MakeNewNetworkDrive.VBS file into your C:\Windows\System32 dir, and there you go!MakeNewNetDrive.vbs Link to comment Share on other sites More sharing options...
brian873 Posted January 21, 2005 Author Share Posted January 21, 2005 mattofakjust tested got this error....any ideas ? Link to comment Share on other sites More sharing options...
mattofak Posted January 21, 2005 Share Posted January 21, 2005 interesting, it happens on one of my computers too... don't know quite what causes it, more research is required... *delves head back into the dusty dark bowls on winxp*[edit]i think it might be caused by the .NET framework not being installed, it updates the ms script host... so that might be part of the problem, do you have it installed on your comp? Link to comment Share on other sites More sharing options...
brian873 Posted January 24, 2005 Author Share Posted January 24, 2005 the pc i was usng did not hve .net, so i installed the fulll version, rebooted and still no luck.we're getting there I thin.hail hail Link to comment Share on other sites More sharing options...
prathapml Posted January 24, 2005 Share Posted January 24, 2005 This adds the right click option, I am thinking I may need to do a batch file to map the drive. I dont know how to pass the current folder through the NET command%CD% = current directory. Link to comment Share on other sites More sharing options...
brian873 Posted January 24, 2005 Author Share Posted January 24, 2005 THANKS Parthapml at the moment i am using [HKEY_CLASSES_ROOT\Directory\shell\Map Drive Here\command]@="net use I: %1"can you tell me the benefit or difference of the %1 compared to %CD% ?Thanks again...hail hail Link to comment Share on other sites More sharing options...
prathapml Posted January 25, 2005 Share Posted January 25, 2005 It was only a suggestion. Use whichever one works properly for you - AND DON'T FORGET to post what did work for you! Link to comment Share on other sites More sharing options...
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