#198098 - 2010-03-19 03:36 PM
Drive Mapping Friendly Names
|
Aten
Just in Town
Registered: 2010-03-19
Posts: 4
Loc: London
|
Hello,
Could someone please point me in the right direction if I am using a KIX script to map a network drive bases on Group membership how can I change the name to something else of the drive thus removing the servername etc
So if my script was:
if ingroup "Remote users" net use x: "\\myserver\remote"
I do not want the drive to show as \\myserver\remote but something different such as Your Drive
Thanks in Advance
|
|
Top
|
|
|
|
#198102 - 2010-03-19 04:37 PM
Re: Drive Mapping Friendly Names
[Re: Mart]
|
Aten
Just in Town
Registered: 2010-03-19
Posts: 4
Loc: London
|
Hi Mart,
DOH yes i meant use as opposed to net use thank you that is exactly what I was looking for
|
|
Top
|
|
|
|
#198141 - 2010-03-23 05:47 PM
Re: Drive Mapping Friendly Names
[Re: Mart]
|
Aten
Just in Town
Registered: 2010-03-19
Posts: 4
Loc: London
|
Hi Mart,
It does not seem to work below is my login script please could you tell me of any errors you could spot and exactly etc I have removed the Label and modified domain names and paths it works without label but not with it I have placed this syntax Label('x:\','my fancy new name') after use x: any ideas?
;*****************************************************
;* *
;* LOGON DRIVE MAPPINGS *
;* MYCOMPANY *
;*****************************************************
;*****************************************************
;* MYCOMPANY USER DRIVE MAPPINGS *
;*****************************************************
Cls
Color g+/n
Box (2,6,9,65,Double)
Color w+/n
AT ( 4,8) "WELCOME TO THE MYCOMPANY NETWORK"
AT ( 7,13) "Connecting Network Resources, Please Wait....."
; DEPARTMENTS
; ***********
; Mappings for all users
IF Ingroup("Domain Users")
use U: "\\MYDOMAIN.LOCAL\USERS\%username%$"
MD "U:\Favorites"
WRITEVALUE ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders","Favorites","U:\Favorites","REG_EXPAND_SZ")
ENDIF
IF Ingroup ("DRIVE 7")
use A: "\\MYDOMAIN.LOCAL\DRIVE7"
ENDIF
If Ingroup ("DRIVE 6")
use J: "\\MYDOMAIN.LOCAL\DRIVE6"
ENDIF
If Ingroup ("IT DRIVE")
use I: "\\MYDOMAIN.LOCAL\IT$"
ENDIF
If Ingroup ("DRIVE 5")
use L: "\\MYDOMAIN.LOCAL\MYCOMPANY"
ENDIF
If Ingroup ("DRIVE 4")
use M: "\\MYDOMAIN.LOCAL\PLUS"
ENDIF
If Ingroup ("DRIVE 3")
use N: "\\MYDOMAIN.LOCAL\DRIVE4"
ENDIF
If Ingroup ("DRIVE 2")
use O: "\\MYDOMAIN.LOCAL\PLUS1"
ENDIF
If Ingroup ("DOMAIN USERS")
use S: "\\MYDOMAIN.LOCAL\SCANNER"
ENDIF
If Ingroup ("DOMAIN USERS")
use P: "\\MYDOMAIN.LOCAL\PUBLIC"
ENDIF
If Ingroup ("DRIVE 1")
use T: "\\MYDOMAIN.LOCAL\PLUS2"
ENDIF
If Ingroup ("FTP")
use V: "\\MYDOMAIN.LOCAL\FTP"
ENDIF
If Ingroup ("MYCOMPANY RESEARCH")
use W: "\\MYDOMAIN.LOCAL\MYCOMPANY RESEARCH"
ENDIF
exit
Edited by Mart (2010-03-23 05:59 PM) Edit Reason: Added code tags.
|
|
Top
|
|
|
|
#198144 - 2010-03-23 05:54 PM
Re: Drive Mapping Friendly Names
[Re: Aten]
|
Aten
Just in Town
Registered: 2010-03-19
Posts: 4
Loc: London
|
Ok I am getting error "unknown label" so it looks like it does not know what label is do I need to add to my script the part DO NOT MODIFY ANYTHING BELOW THIS LINE. ;BELOW IS A UDF AND IT COME SREADY FOR USE. at the bottom of my script can I not just use a one line syntax? such as use x: something alone the lines of label x: "my drive"
|
|
Top
|
|
|
|
#198685 - 2010-05-20 07:30 PM
Re: Drive Mapping Friendly Names
[Re: Mart]
|
Ooter
Fresh Scripter
Registered: 2010-05-20
Posts: 15
Loc: Sacramento, CA
|
I am using this "label" script. The issue I am having is drives are randomly not being labeled. My best bet is the drive is being labeled before the drive is fully mapped. Since the drive doesn't exist yet, the label doesn't rename the mapped drive. Is there a way to make the label loop or to not execute until the drive is mapped?
|
|
Top
|
|
|
|
#198696 - 2010-05-21 10:25 AM
Re: Drive Mapping Friendly Names
[Re: Mart]
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Ick - permanent loops bad.
$iInterval=0.1 ; Check for presence every 10th of a second
$iMaxWait=10.0 ; Don't wait any more than 10 seconds
Use x: "\\server\share"
While @ERROR=0 AND Not Exist("x:\") AND $iMaxWait>0
Sleep $iInterval
$iMaxWait=$iMaxWait-$iInterVal
Loop
If Exist("x:\")
;Label script goes here
EndIf
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 581 anonymous users online.
|
|
|