Page 1 of 1 1
Topic Options
#103355 - 2003-08-01 03:49 PM follow up on the drive mapping
ikmps Offline
Fresh Scripter

Registered: 2003-05-04
Posts: 37
Loc: Newcastle
Hi all

Following on from the previous post, we have setup the lines as shown below which works ok

if ingroup ("normal school")
use y: "\\$lserver\the y drive$"
use w: "\\$lServer\sch Staff Docs$"

if @userid="user1"
use k: "\\$lserver\user1_desktop$"
DbgMessage("Info ","personnel drive mapped user1_desktop")
else
if @userid="user2"
use k: "\\$lserver\user2_desktop$"
DbgMessage("Info ","personnel drive mapped user2_desktop")
else
if @userid="user3"
use k: "\\$lserver\user3_desktop$"
DbgMessage("Info ","personnel drive mapped user3_desktop")
else
use k: "\\$lserver\front office desktop$"
DbgMessage("Info ","Staff Docs")

endif

if ingroup ("school admin")

use i: "\\$lserver\sim$"

use y: "\\$lserver\the-y-drive$"
use w: "\\$lServer\sch Staff Docs$
endif
CLC Groups
if ingroup ("clc staff")

use o: "\\$lserver\clc normal home folders$"
use y: "\\$lserver\clc-staff$"

use m: "\\$lserver\online$" ;drive mapping for SIR icons
use h: "\\$lserver\global" ;drive mapping for SIR
if @userid="user45"
use k: "\\stmsite-rc1\user45_desktop$"
DbgMessage("Info ","personnel drive mapped user45_desktop")
else
if @userid="user46"
use k: "\\$lserver\user46_desktop$"
DbgMessage("Info ","personnel drive mapped user46_desktop")
else
use k: "\\$lserver\clc staff desktop$"
DbgMessage("Info ","clc staff drives")

Endif

Works fine if you are a member of the first group (if ingroup ("normal school") also maps ok in you are a member of school admin as well

But when you are not member of either group none of the drive mapping works for anything below that section it seems to end the script and return back to the main script.

Thanks for any help

Top
#103356 - 2003-08-01 04:07 PM Re: follow up on the drive mapping
Richie19Rich77 Offline
Seasoned Scripter
*****

Registered: 2002-08-16
Posts: 624
Loc: London, England
Everytime you use a IF statment, you must finish it wil a EndIF
code:
if ingroup ("normal school")
use y: "\\$lserver\the y drive$"
use w: "\\$lServer\sch Staff Docs$"

if @userid="user1"
use k: "\\$lserver\user1_desktop$"
DbgMessage("Info ","personnel drive mapped user1_desktop")
Else
if @userid="user2"
use k: "\\$lserver\user2_desktop$"
DbgMessage("Info ","personnel drive mapped user2_desktop")
Else
if @userid="user3"
use k: "\\$lserver\user3_desktop$"
DbgMessage("Info ","personnel drive mapped user3_desktop")
Else
use k: "\\$lserver\front office desktop$"
DbgMessage("Info ","Staff Docs")
EndIF
EndIF
Endif
Endif



[ 01. August 2003, 16:09: Message edited by: Richard Farthing ]

Top
#103357 - 2003-08-01 04:10 PM Re: follow up on the drive mapping
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
This is how your code is executing. I do not think it is what you want. Proper use of Endif is required as Richard states.

code:
if ingroup ("normal school")
use y: "\\$lserver\the y drive$"
use w: "\\$lServer\sch Staff Docs$"

if @userid="user1"
use k: "\\$lserver\user1_desktop$"
DbgMessage("Info ","personnel drive mapped user1_desktop")
else
if @userid="user2"
use k: "\\$lserver\user2_desktop$"
DbgMessage("Info ","personnel drive mapped user2_desktop")
else
if @userid="user3"
use k: "\\$lserver\user3_desktop$"
DbgMessage("Info ","personnel drive mapped user3_desktop")
else
use k: "\\$lserver\front office desktop$"
DbgMessage("Info ","Staff Docs")
endif

if ingroup ("school admin")
use i: "\\$lserver\sim$"
use y: "\\$lserver\the-y-drive$"
use w: "\\$lServer\sch Staff Docs$
endif

;CLC Groups
if ingroup ("clc staff")
use o: "\\$lserver\clc normal home folders$"
use y: "\\$lserver\clc-staff$"
use m: "\\$lserver\online$" ;drive mapping for SIR icons
use h: "\\$lserver\global" ;drive mapping for SIR
if @userid="user45"
use k: "\\stmsite-rc1\user45_desktop$"
DbgMessage("Info ","personnel drive mapped user45_desktop")
else
if @userid="user46"
use k: "\\$lserver\user46_desktop$"
DbgMessage("Info ","personnel drive mapped user46_desktop")
else
use k: "\\$lserver\clc staff desktop$"
DbgMessage("Info ","clc staff drives")
Endif

Oh and
quote:
CLC Groups
the way you have it posted will cause an error.

[ 01. August 2003, 16:12: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#103358 - 2003-08-01 04:24 PM Re: follow up on the drive mapping
Richie19Rich77 Offline
Seasoned Scripter
*****

Registered: 2002-08-16
Posts: 624
Loc: London, England
Here we go this should work.... I hope [Big Grin]

code:
If InGroup ("normal school")
Use y: "\\$lserver\the y drive$"
Use w: "\\$lServer\sch Staff Docs$"

$x = 1
For $Loop = $x to 3
If @userid="user" + $x
Use k: "\\$lserver\user" + $x "_desktop$"
Else
Use k: "\\$lserver\front office desktop$"
DbgMessage("Info ","Staff Docs")
EndIf

If $x = 1
DbgMessage("Info ","personnel drive mapped user1_desktop")
Else
If $x = 2 OR 3
DbgMessage("Info ","personnel drive mapped user" + $x +"_desktop")
EndIf

EndIf
Next
Else
Use i: "\\$lserver\sim$"
Use y: "\\$lserver\the-y-drive$"
Use w: "\\$lServer\sch Staff Docs$"

If InGroup ("clc staff")
Use o: "\\$lserver\clc normal home folders$"
Use y: "\\$lserver\clc-staff$"
Use m: "\\$lserver\online$" ;drive mapping for SIR icons
Use h: "\\$lserver\global" ;drive mapping for SIR
Else
If @userid="user45"
Use k: "\\stmsite-rc1\user45_desktop$"
DbgMessage("Info ","personnel drive mapped user45_desktop")
Else
If @userid="user46"
Use k: "\\$lserver\user46_desktop$"
DbgMessage("Info ","personnel drive mapped user46_desktop")
Else
Use k: "\\$lserver\clc staff desktop$"
DbgMessage("Info ","clc staff drives")
EndIf
EndIf
EndIf
EndIf



[ 01. August 2003, 16:27: Message edited by: Richard Farthing ]

Top
#103359 - 2003-08-01 04:31 PM Re: follow up on the drive mapping
ikmps Offline
Fresh Scripter

Registered: 2003-05-04
Posts: 37
Loc: Newcastle
thanks for the relpies

what i need is desktops to follow selected users around diffrent machines

i have just tried adding a block of endif's to the end of the section which made no diffrence

do i need to

if @userid="user46" use k: "\\$lserver\user46_desktop$" DbgMessage("Info ","personnel drive mapped user46_desktop") else use k: "\\$lserver\clc staff desktop$" DbgMessage("Info ","clc staff drives") Endif

for each user that needs thier own desktop

Top
#103360 - 2003-08-01 04:43 PM Re: follow up on the drive mapping
ikmps Offline
Fresh Scripter

Registered: 2003-05-04
Posts: 37
Loc: Newcastle
Richard

What I have got if different groups with selected users within the group needing the desktop to follow then ie the named users per group with the rest to have a default desktop. The file was broken into “normal school” user group, “school admin” user group and “clc staff” user group with named users per group

So following your post can I use the loops within each group check for the user name ???

thanks

Top
#103361 - 2003-08-01 04:56 PM Re: follow up on the drive mapping
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Or you can see if Select ...case...Endselect would do what you want.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#103362 - 2003-08-01 07:11 PM Re: follow up on the drive mapping
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You should also keep variables outside strings and the $ signs of the hidden shares might need doubling up as described in the Kixtart Manual.

You should also properly indent code so that one can actually read the different code blocks.

Before mapping a drive letter, the drive might need to be unmapped if users tend to map their own drives via
code:
use r: /delete /persistent

or use any of the MapDrive() UDFs for all your mappings to be consistent.

[ 02. August 2003, 14:36: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#103363 - 2003-08-04 02:13 PM Re: follow up on the drive mapping
ikmps Offline
Fresh Scripter

Registered: 2003-05-04
Posts: 37
Loc: Newcastle
thanks to all who replied

i have ended up mapping the default drive at the start of the ingroup test then doing a seperate if else for each user ( deleting the default desktop if the user matches)

if ingroup ("normal school")

use y: "\\$lserver\the y drive$"
use w: "\\$lserver\sch staff docs$"

use k: /delete/persistent
use k: "\\$lserver\sch staff desktop$"
dbgmessage("info ","staff desktop")

if @userid="user1"
use k: /delete/persistent
use k: "\\$lserver\user_desktop$"
dbgmessage("info ","personnel drive mapped user_desktop")
else

endif

not the best way to do it but it works for the moment until i get time to look into some more

Paul

Top
Page 1 of 1 1


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

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.07 seconds in which 0.035 seconds were spent on a total of 12 queries. Zlib compression enabled.

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