Jump to content

MAP network drive here.


Recommended Posts

Posted

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


Posted

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]

Posted

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 far

Registry :

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 command

hail hail

Posted

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...

Posted

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

Posted

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

Posted

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

Posted

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"

Posted

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

Posted

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?

Posted

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

Posted
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.

Posted

THANKS Parthapml :D

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...