Page 1 of 1 1
Topic Options
#175722 - 2007-04-26 04:27 PM Shares with user friendly names
Onno van den Berg Offline
Lurker

Registered: 2003-08-25
Posts: 4
Loc: The Netherlands
Is it possible to extend the function of the USE command to insert a friendly name for the network connection that is being made with the USE command. Using the code underneath it is possible to change the name of the network connection (\\fileserver\apps$) to the name \\fileserver\applications.

mapschijf “X”, “\\server\gebruiker$”, “Persoonlijke mappen”
mapschijf “Y”, “\\server\data$”, “Bedrijfsdata”
mapschijf “Z”, “\\server\apps$”, “Applicaties”
Function mapschijf(schijfletter,lokatie, omschrijving)
mDrive = schijfletter & “:”
WshNetwork.MapNetworkDrive mDrive, lokatie
Set oShell = CreateObject(”Shell.Application”)
oShell.NameSpace(mDrive).Self.Name = omschrijving
End Function

Top
#175726 - 2007-04-26 07:07 PM Re: Shares with user friendly names [Re: Onno van den Berg]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm...
that actually doesn't work in logonscript. at least with kixtart. never tried with vbs.

but, the idea is good. on the other hand, one could always set the friendly name at the server side.
_________________________
!

download KiXnet

Top
#175727 - 2007-04-26 07:20 PM Re: Shares with user friendly names [Re: Lonkero]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Or one could use the Label() UDF.
Imho that is enough. Buy hey that’s just my opinion. If there is a valid reason to have this then implementing it into kix32.exe and wkix32.exe would be understandable.

Label() - Read & Write Drive Label
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#175741 - 2007-04-27 08:36 AM Re: Shares with user friendly names [Re: Mart]
Arend_ Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
Written this years ago:
 Code:
Function DriveName($Drive,$Name)
  Dim $Shell
  $Shell = CreateObject("Shell.Application")
  $Shell.NameSpace($Drive).Self.Name = $Name
EndFunction

Top
#175749 - 2007-04-27 01:03 PM Re: Shares with user friendly names [Re: Arend_]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
heh. looks close to same :p
_________________________
!

download KiXnet

Top
#175770 - 2007-04-27 05:51 PM Re: Shares with user friendly names [Re: Lonkero]
Arend_ Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
Heh, indeed it does, back then I converted all my vbs scripts to kix \:\)
Top
#175792 - 2007-04-29 02:20 AM Re: Shares with user friendly names [Re: Arend_]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Even at least one of the MAPDRIVE() UDFs supports labeling.
_________________________
There are two types of vessels, submarines and targets.

Top
#175795 - 2007-04-29 08:34 AM Re: Shares with user friendly names [Re: Sealeopard]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yep.
but again, labeling in logonscript is all about luck.
sometimes it works, mostly not.
_________________________
!

download KiXnet

Top
#175797 - 2007-04-29 12:19 PM Re: Shares with user friendly names [Re: Lonkero]
Arend_ Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
No such thing as luck, it's called "timing" ;\)
Top
#175801 - 2007-04-29 03:23 PM Re: Shares with user friendly names [Re: Arend_]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
oh, I think you are right.
but luck sounds better :p
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 652 anonymous users online.
Newest Members
min_seow, Audio, Hoschi, Comet, rrosell
17881 Registered Users

Generated in 0.058 seconds in which 0.024 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org