Page 1 of 1 1
Topic Options
#129663 - 2004-11-17 12:07 PM mapping drives
Anonymous
Unregistered


i am having trouble getting KIX to map my drives.

here is a bit of my script, but i cant seem to get it to map the drives

;---Ip address Variables---
BREAK ON
$1st=TRIM(SPLIT(@IPADDRESS0,'.')[0])
$2nd=TRIM(SPLIT(@IPADDRESS0,'.')[1])
$3rd=TRIM(SPLIT(@IPADDRESS0,'.')[2])
$4th=TRIM(SPLIT(@IPADDRESS0,'.')[3])



IF $3rd = 0
"Setting Borehamwood Drive Mappings"
use G: '\\millen\g_drive\'
use H: '\\millen\_root\'
use P: '\\millen\@USERID\'
Exit
Endif

IF $3rd = 1
"Setting Alconbury Drive Mappings"
use G: "\\titania\g_drive\"
use H: '\\titania\_root\'
use P: '\\titania\@USERID\'
Exit
Endif

any help greatly appreciated

Top
#129664 - 2004-11-17 12:12 PM Re: mapping drives
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
try comparing against strings instead of integers (IF $3rd = "1")
_________________________



Top
#129665 - 2004-11-17 12:24 PM Re: mapping drives
Anonymous
Unregistered


its not that, the IP thing works fine. even if i use this file

;--------start map.kix--------

use g: "\\titania\apps\"

;--------end map.kix--------

it still dosent work, i think i'm being ditsy i'm sure i'm just being a fool

Top
#129666 - 2004-11-17 12:47 PM Re: mapping drives
AzzerShaw Offline
Seasoned Scripter
****

Registered: 2003-02-20
Posts: 510
Loc: Cheltenham, England
What version of Kix are you using?

Also try this:

Code:
 


;---Ip address Variables---
BREAK ON
$1st=TRIM(SPLIT(@IPADDRESS0,'.')[0])
$2nd=TRIM(SPLIT(@IPADDRESS0,'.')[1])
$3rd=TRIM(SPLIT(@IPADDRESS0,'.')[2])
$4th=TRIM(SPLIT(@IPADDRESS0,'.')[3])



IF $3rd = 0
"Setting Borehamwood Drive Mappings"
use G: '\\millen\g_drive'
use H: '\\millen\_root'
use P: '\\millen\@USERID'
Exit
Endif

IF $3rd = 1
"Setting Alconbury Drive Mappings"
use G: "\\titania\g_drive"
use H: '\\titania\_root'
use P: '\\titania\@USERID'
Exit
Endif

any help greatly appreciated




Edited by AzzerShaw (2004-11-17 12:48 PM)
_________________________
If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. - W.C Fields

Top
#129667 - 2004-11-17 12:57 PM Re: mapping drives
Anonymous
Unregistered


the latest version

thanks that worked!

Top
#129668 - 2004-11-17 01:24 PM Re: mapping drives
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
huh?

where is the difference in code to the first post ??
Why should it work with the very same when it failed with the same
_________________________



Top
#129669 - 2004-11-17 01:28 PM Re: mapping drives
AzzerShaw Offline
Seasoned Scripter
****

Registered: 2003-02-20
Posts: 510
Loc: Cheltenham, England
Because he had put :

use G: '\\titania\g_drive\'

and that wont work

this is what i put

use G: "\\titania\g_drive"


Aaron



_________________________
If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. - W.C Fields

Top
#129670 - 2004-11-17 01:59 PM Re: mapping drives
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
aaaaaahhh
I saw the light!

still he should consider comparing strings with strings and integers with integers ... speaking of good coding habits !
_________________________



Top
#129671 - 2004-11-17 03:31 PM Re: mapping drives
Cybex Offline
Getting the hang of it
*****

Registered: 2004-07-21
Posts: 81
Loc: Brandon, FL.
Here is another way to approach this.

Code:

$m="millen"
$t="titania"
SELECT
Case Trim(Split(@IPADDRESS0,'.')[2]) = "0"
$v=$m
Case Trim(Split(@IPADDRESS0,'.')[2]) = "1"
$v=$t
EndSelect
Use G: "\\"+$v+"\g_drive"
Use H: "\\"+$v+"\_root"
Use P: "\\"+$v+"\@USERID"
Exit



Edited by Cybex (2004-11-17 05:08 PM)
_________________________
Common sense isn't so common.

Top
#129672 - 2004-11-17 04:18 PM Re: mapping drives
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Why make them persistent if they are mapped on every logon?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#129673 - 2004-11-17 05:15 PM Re: mapping drives
Cybex Offline
Getting the hang of it
*****

Registered: 2004-07-21
Posts: 81
Loc: Brandon, FL.
Changed it... Sorry, didn't know the context of the snippet of code he presented and how it was intented to be used. It was an example... Nothing more, nothing less!
_________________________
Common sense isn't so common.

Top
#129674 - 2004-11-17 05:27 PM Re: mapping drives
Anonymous
Unregistered


they are not persistent anymore i realised that after posting the code.

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
1 registered (Allen) and 641 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.061 seconds in which 0.025 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