Page 1 of 1 1
Topic Options
#176977 - 2007-06-14 02:35 PM AD login script which maps network drives
lakn Offline
Fresh Scripter

Registered: 2007-06-14
Posts: 8
Hi,
Is it possible to create a kix script that map networkdrives in a way so that they reconnect at each logon? (like the option "reconnect at logon" when you manually map a drive)
We are currently running this logon script, but lately it has been nothing but trouble. What I need is a kix script to map all the drives with reconnect at logon, so I can run this once on each client, instead of having to do it manually on each computer. Is that possible?

 Code:
 
;
;  KIXTART.SCR
;
;  Bioimage Kixtart Logon script ver. 1.7
;

CLS
;SetTime "\\Vale"

;AT (1,1)@userid              ; ...and some macro's
;AT (2,1)@fullname
;AT (3,1)@wksta
;AT (4,1)@lserver
;AT (5,1)@INWIN 

; Mapping Std. drive to everybody

Use "*" /Delete 					; Delete all mappings

;Bohr
Use L: "\\Bohr\Programs$"				; Maps Programs Drive
Use M: "\\bohr\Compound$" 				; Maps Incell Data
Use N: "\\bohr\AssayDev$" 				; Maps Incell Data
Use O: "\\Bohr\Swapzone"				; Maps the SwapZone
Use P: "\\Bohr\@userID$" 				; Maps the Personal drive
Use Q: "\\Bohr\Projects$"				; Maps Project drive
Use R: "\\Bohr\Functions$"				; Maps Functions drive
Use T: "\\Bohr\Templates$"				; Maps Templates drive

;Armenius
Use U: "\\Armenius\Compound_data"			; Maps Compound_data på Armenius
Use Y: "\\Armenius\Assay_development_data"		; Maps Assay data drive
Use Z: "\\Armenius\Docstore$"				; Maps the Docstore drive
Use I: "\\Armenius\BioImage Procedure Library (BIPL)" 	; Maps the New SOP-File drive

If @userid ='Jadc'
	Use V: "\\Bohr\software$" 			; Maps Software drive for specific users
EndIf

If @userid ='LaKN'
	Use V: "\\Bohr\software$" 			; Maps Software drive for specific users
EndIf

If @INWIN = 2
	;Use W: "\\Thor\win98$"
	Use Y: "\\Armenius\assay_Data"
	Use J: "\\Armenius\comdata"
EndIf

If @wksta = LSM_MICRO
	Goto End
EndIf

If @wksta = INcell_PC
	Goto End
EndIf

If @wksta = ALPHA5
	Goto End
EndIf

if @wksta = zymark
	Goto End
Endif

; Antivirus

If @WKSTA = odin
	Goto end
Else
	Goto Thor
EndIf

:Thor
If @WKSTA = Thor
	Goto end
Else
	Goto Bohr
EndIf

:Bohr
If @WKSTA = Bohr
	Goto end
Else
	Goto Armenius
EndIf

:Armenius
If @WKSTA = Armenius
	Goto end
Else
	Goto end
EndIf
:end
Cookie1

Top
#176978 - 2007-06-14 02:43 PM Re: AD login script which maps network drives [Re: lakn]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
/persistent
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#177003 - 2007-06-15 12:47 PM Re: AD login script which maps network drives [Re: Les]
lakn Offline
Fresh Scripter

Registered: 2007-06-14
Posts: 8
So, for instance:

Use L /persistent: "\\Bohr\Programs$"

?

Thank you in advance \:\)

Top
#177004 - 2007-06-15 12:55 PM Re: AD login script which maps network drives [Re: lakn]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Yes that's right, though more usually like this:
 Code:
USE "L:" "\\Bohr\Programs$$" /PERSISTENT

Top
#177005 - 2007-06-15 01:24 PM Re: AD login script which maps network drives [Re: Richard H.]
lakn Offline
Fresh Scripter

Registered: 2007-06-14
Posts: 8
Thank you both. I will give it a try \:\)
Top
#177010 - 2007-06-15 01:58 PM Re: AD login script which maps network drives [Re: lakn]
lakn Offline
Fresh Scripter

Registered: 2007-06-14
Posts: 8
Hi Again \:\)
Is it possible to create a condition for mapping the drives, like if the drive "L:" is allready mapped -> do nothing, else USE "L:" "\\Bohr\Programs$$" /PERSISTENT? If so could anybody show me for one of the drives?
Regards
Lars Kragh

Top
#177012 - 2007-06-15 02:07 PM Re: AD login script which maps network drives [Re: lakn]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
Sure. You could do something like the code below. Be careful because it could be that the mapped drive points to the wrong share. Just deleting all drives you want to map would be my choice.

 Code:
Break on

If Exist("L:\")
	?"Yep"
Else
	?"Nope"
EndIf


Edited by Mart (2007-06-15 02:13 PM)
Edit Reason: Typo.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#177013 - 2007-06-15 02:16 PM Re: AD login script which maps network drives [Re: Mart]
lakn Offline
Fresh Scripter

Registered: 2007-06-14
Posts: 8
Hi Mart,
Sounds good. What you mean is, if someone allready has a drive mapped as "L" from a different network connection?
So where should the USE "L:" "\\Bohr\Programs$$" /PERSISTENT go? (sorry, but im a coding retard)

Top
#177014 - 2007-06-15 02:19 PM Re: AD login script which maps network drives [Re: lakn]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
Remove ?"nope"and put the code to map the drive there.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#177016 - 2007-06-15 02:42 PM Re: AD login script which maps network drives [Re: Mart]
lakn Offline
Fresh Scripter

Registered: 2007-06-14
Posts: 8
Hi,
No, what I mean is, how would the code look like for checking if a drive letter is allready mapped and if not, map the drive persistent. Could you write a full example of this?

Top
#177017 - 2007-06-15 02:58 PM Re: AD login script which maps network drives [Re: lakn]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
 Code:
If Not Exist('L:\')
  Use 'L:' '\\Bohr\Programs$$' /persistent
EndIf
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#177019 - 2007-06-15 03:11 PM Re: AD login script which maps network drives [Re: Les]
lakn Offline
Fresh Scripter

Registered: 2007-06-14
Posts: 8
Thank you Les!
Top
#177021 - 2007-06-15 03:20 PM Re: AD login script which maps network drives [Re: lakn]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
 Originally Posted By: lakn

....
Could you write a full example of this?


I don't get it. What is so difficult about replacing one line with an other line?
You'll learn kixtart by using kixtart and coding (at least trying to code) what you want. Silver platters are nice but do you really know what the stuff on the silver platter does and how to modify it if it does not fully fit your needs? I guess not.

I’m not trying to put you down especially because you are new to this board and I don’t know your kixtart skills but I assumed that copying and pasting one line of code would not be that hard.
Anyway, if you have any more question don’t be afraid to ask.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#177026 - 2007-06-15 04:54 PM Re: AD login script which maps network drives [Re: Mart]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1894
Loc: Hilversum, The Netherlands
 Originally Posted By: Mart
 Originally Posted By: lakn

....
Could you write a full example of this?

I don't get it. What is so difficult about replacing one line with an other line?
You'll learn kixtart by using kixtart and coding (at least trying to code) what you want. Silver platters are nice but do you really know what the stuff on the silver platter does and how to modify it if it does not fully fit your needs? I guess not.

I’m not trying to put you down especially because you are new to this board and I don’t know your kixtart skills but I assumed that copying and pasting one line of code would not be that hard.
Anyway, if you have any more question don’t be afraid to ask.


With some ppl it takes longer to get, some of them might be under stress that it needs to be done within a certain amount of time and therefore have no time to figure it out themselves. I don't agree with those motives but they are motives used by alot of ppl nonetheless, asking for help usually is asking for an answer not a "how to" to get there \:\)

However personally I do agree with you.

Top
#177038 - 2007-06-18 10:45 AM Re: AD login script which maps network drives [Re: Arend_]
lakn Offline
Fresh Scripter

Registered: 2007-06-14
Posts: 8
Hi,
I aggree with both of you and I am sorry. Its all about learning and not copy/pasting. The thing is, as apronk so kindly said, I didnt have time to learn how to code Kixtart. I needed to modify an active directory script, that a former employee made years back and then never touch it again (crossed fingers). Anyways, I thank you all for the help. Next time I won't ask for the full solution.

Top
Page 1 of 1 1


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

Who's Online
0 registered and 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.051 seconds in which 0.017 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