Jump to content

Rename (label) network folder


aggg63
 Share

Recommended Posts

I'm not sure I understand your question, are you asking if its possible to remotely rename a network share? I.E. change:

\\myserver\share1

to

\\myserver\share2

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

I'm not sure I understand your question, are you asking if its possible to remotely rename a network share? I.E. change:

\\myserver\share1

to

\\myserver\share2

Sample.

In Explorer I have "Finances on '192.168.1.1' G:" because I mapped \\192.168.1.1\Finances to G:. I can change the name pressing F2, I write "Finances" and I get "Finances G:". If the mapped drive is permanent, this is remenber by Windows at next logon or reboot. But, how can script this to configure several machines to mask the network addres to final user? DriveSetLabel only work for fixed disk. Any ideas. Thanks again.

Link to comment
Share on other sites

Sample.

In Explorer I have "Finances on '192.168.1.1' G:" because I mapped \\192.168.1.1\Finances to G:. I can change the name pressing F2, I write "Finances" and I get "Finances G:". If the mapped drive is permanent, this is remenber by Windows at next logon or reboot. But, how can script this to configure several machines to mask the network addres to final user? DriveSetLabel only work for fixed disk. Any ideas. Thanks again.

When you do that, a registry key is added to the registry for the current user for the specified mountpoint. The specific key is "_LabelFromReg". When that's not there, Windows just comes up with the label based on the resource (obviously). There's also a key in there for _LabelFromDesktopINI - I've never done it that way, but it seems if that's a possibility, then I'd go that route.

Registry

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\##192.168.1.1#Finances]
"BaseClass"="Drive"
"_CommentFromDesktopINI"=""
"_LabelFromDesktopINI"=""
"_AutorunStatus"=hex:01,df,df,00,df,01,00,01,01,ee,ff,ff,ff,ff,ff,ff,ff,ff,ff,\
  ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,\
  ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,\
  ff,ff,00,00,20,00,00,08,00,00,00
"_LabelFromReg"="New Label"

So, to do this in autoit - you would have a line like:

RegWrite ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\##192.168.1.1#Finances", "_LabelFromReg", "REG_SZ", "New Label")

An application to do this only seems overkill. But, you could include this same change in your login scripts using VBS or KIXTART or whatever you use.

Ben

Link to comment
Share on other sites

Sample.

In Explorer I have "Finances on '192.168.1.1' G:" because I mapped \\192.168.1.1\Finances to G:. I can change the name pressing F2, I write "Finances" and I get "Finances G:". If the mapped drive is permanent, this is remenber by Windows at next logon or reboot. But, how can script this to configure several machines to mask the network addres to final user? DriveSetLabel only work for fixed disk. Any ideas. Thanks again.

if you go to the computer that is sharing the folder, you can right click on the folder, and go to sharing and security. select to share it across the network, and give it whatever name you want. then when they map to that share, they're not seeing the file path too it, they're just seeing the name you've given it, and the computer name.

Link to comment
Share on other sites

Hello.

@bboysza:

I don' have this key

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\##192.168.1.1#Finances

I have this

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\G\_LabelFromReg

and in the key Cache there is the new label.

My system is Windows 2000 (SP4)

@CyberSlug:

I'm sorry but the script you point me doesn't compile with AutoIt (I have installed WSH 5.6)

Disk = "Q:"
Set oShell = CreateObject("Shell.Application")
oShell.NameSpace(Disk).Self.Name = "finances"

I get the error in attached file.

@cameronsdad:

I can't go to server because is a file system in a Unix machine with Samba server, not a Windows server. More, we don't want to see the server name or IP, only a description label.

Thanks again for your answers.

Link to comment
Share on other sites

Hello.

@bboysza:

I don' have this key

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\##192.168.1.1#Finances

I have this

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\G\_LabelFromReg

and in the key Cache there is the new label.

My system is Windows 2000 (SP4)

Ah - it's changed then in XP. In anycase, it's clear all you need to do is update that key.

Do you use any login scripts? If so, which type? I ask because I know it'll be easier and faster to just add the reg update to say, a Kix script. In fact, there's scripts already that do exactly what you want to do.

http://www.kixtart.org/ubbthreads/showflat...2531&Main=82999

It's an old post, so you should add some OS detection in there to customize for the changes introduced in XP.

Ben

Link to comment
Share on other sites

@CyberSlug:

I'm sorry but the script you point me doesn't compile with AutoIt (I have installed WSH 5.6)

Did you try the the following with the latest beta version of AutoIt?
$driveLetter = "X:"
DriveMapAdd($driveLetter, "\\SERVER\SHARE")

$oShell = ObjCreate("shell.application")
$oShell.NameSpace($driveLetter).Self.Name = "New name goes here"

If you want to use VBScript, the code at the Oreilly site should work on Windows 2000 and XP.

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

Did you try the the following with the latest beta version of AutoIt?

$driveLetter = "X:"
DriveMapAdd($driveLetter, "\\SERVER\SHARE")

$oShell = ObjCreate("shell.application")
$oShell.NameSpace($driveLetter).Self.Name = "New name goes here"

If you want to use VBScript, the code at the Oreilly site should work on Windows 2000 and XP.

Yes, I have the latest Beta, build 110.

And also I run teh Visual BAsic script with no results.

I'm sorry, but nothing works :o

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
 Share

  • Recently Browsing   0 members

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