Jump to content

MAP network drive here.


brian873

Recommended Posts


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

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

Link to comment
Share on other sites

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

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

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

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

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

Link to comment
Share on other sites

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