Page 1 of 2 12>
Topic Options
#17011 - 2002-02-04 09:00 PM HELP! Simple Mappings Don't Work
Anonymous
Unregistered


Help! Kix hates me.

Win2K Pro workstation, Win2K AD servers.

Calling Kix as follows from batch file (as logon script):

kix script.kix

Script.kix reads like this:

use h: @homeshare

if ingroup("sharinfo-clients.isv.rsmt")
use o: "\\washington\clients"
endif

@homeshare line is ignored and I get the following error:

Script error : error in USE statement !
if ingroup("sharinfo-clients.isv.rsmt") = 1

If I take the use o: "\\washington\clients" statement out of the IF structure, I still get:

Script error : error in USE statement !
use o: "\\washington\clients"

I'm a newbie, but this seems simple. What am I doing wrong?

Thanks,
Chaz

Top
#17012 - 2002-02-04 09:05 PM Re: HELP! Simple Mappings Don't Work
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Hi Charles, welcome to the board.

Might want to try @HOMESHR instead of @HOMESHARE

-Shawn

Top
#17013 - 2002-02-04 09:31 PM Re: HELP! Simple Mappings Don't Work
Anonymous
Unregistered


First of all, sorry, I should have caught that.

Second, That seems to have done the trick at least for the home directory mapping.

While I do a little more testing on the second part, riddle me this, can I use a one-line format for the IF statement, like:

if ingroup("sharinfo-clients.isv.rsmt") use o: "\\washington\clients" endif

Top
#17014 - 2002-02-04 10:03 PM Re: HELP! Simple Mappings Don't Work
bleonard Offline
Seasoned Scripter
*****

Registered: 2001-01-19
Posts: 581
Loc: Chicago, IL
Charles -
You can use 1 line formats for IF and CASE statements:
SELECT
CASE (xxx) DO1 DO2 DO3
CASE (1) RETURN
ENDSELECT

Bill

Top
#17015 - 2002-02-04 10:09 PM Re: HELP! Simple Mappings Don't Work
Anonymous
Unregistered


Bill,

Thanks for the confirmation.

I'm a little confused (or ignorant) about the RPC service and exactly what features require it. Here is the entire text of my script:
_____________________________________________
; @echo off
; There is a section for all of Rosemont and individual sections for each of
; the business groups. After the Rosemont section runs, user is tested for membership
; in each business group. If they are a member, that section is processed. If not, the
; script skips to the next business group. First business group commented.


; Login script for rsmt******************************************************

; Maps users' home directories.
use h: @homeshr

if ingroup("sharinfo-clients.isv.rsmt") use o: "\\washington\clients" endif

; These six lines map a drive to every business group's share
; to eliminate the need for individual user logon scripts.
use p: "\\washington\cdrsrw01"
use q: "\\washington\csis"
use r: "\\washington\rsmtcis"
use s: "\\washington\rsmtfin"
use t: "\\washington\rsmtopr"
use u: "\\washington\trade"


; Login script for ccs.rsmt**************************************************

; Test for group membership.
; If not in group, bail out of section.
if not ingroup("ccs.rsmt") goto endccs endif

; Map drive to the share corresponding to this group's 'home' server.
use x: "\\washington\cdrsrw01"

if ingroup("acad.ccs.rsmt") use n: "\\washington\cdrsrw01" endif

if ingroup("ccc group.ccs.rsmt") use k: "\\washington\cdrsrw01" endif

if ingroup("apms.cis.rsmt") use l: "\\washington\rsmtcis" endif

if ingroup("cold.ccs.rsmt") use n: "\\washington\rsmtfin" endif

; Reference point to bail out of section.
:endccs

; Login script for cis.rsmt**************************************************

if not ingroup("cis.rsmt") goto endcis endif

use x: "\\washington\rsmtcis"

if ingroup("apms.cis.rsmt") use l: "\\washington\apms" endif

if ingroup("pvcs.cis.rsmt") use l: "\\washington\apms" endif

if ingroup("pvcs source code.cis.rsmt") use l: "\\washington\apms" endif

:endcis

; Login script for fmd.rsmt**************************************************

if not ingroup("fmd.rsmt") goto endfmd endif

use x: "\\washington\trade"

if ingroup("cold.fmd.rsmt") use n: "\\washington\rsmtfin" endif

if ingroup("governmentfmd.rsmt") use g: "\\washington\trade" endif

if ingroup("fedmark.fmd.rsmt") use n: "\\washington\trade" endif

:endfmd

; Login script for fnc.rsmt**************************************************

if not ingroup("fnc.rsmt") goto endfnc endif

use x: "\\washington\rsmtfin"

if ingroup("anamate") use i: "\\washington\rsmtfin" endif

if ingroup("budget.fnc.rsmt") use g: "\\washington\rsmtfin" endif

if ingroup("billtrk.fnc.rsmt") use j: "\\washington\rsmtfin" endif

if ingroup("cold.fnc.rsmt") use n: "\\washington\rsmtfin" endif

:endfnc

; Login script for isv.rsmt**************************************************

if not ingroup("isv.rsmt") goto endisv endif

use x: "\\washington\csis"

if ingroup("trade-busihelp.isv.rsmt") use l: "\\washington\trade" endif

if ingroup("pvcs.cis.rsmt") use l: "\\washington\apms" endif

if ingroup("pvcs source code.cis.rsmt") use l: "\\washington\apms" endif

:endisv

; Login script for lgl.rsmt**************************************************

if not ingroup("lgl.rsmt") goto endlgl endif

if ingroup("cold.fnc.rsmt.c.us.cdo") use n: "\\washington\rsmtfin" endif

if ingroup("gss.ops.rsmt.c.us.cdo") use g: "\\washington\rsmtopr" endif

:endlgl

; Login script for ops.rsmt**************************************************

if not ingroup("ops.rsmt") goto endops endif

use x: "\\washington\rsmtopr\"

if ingroup("cold.ops.rsmt") use n: "\\washington\rsmtfin" endif

:endops

; Login script for per.rsmt**************************************************

if not ingroup("per.rsmt") goto endper endif

if ingroup("isg-restrict-training.cis.rsmt") use i: "\\washington\rsmtcis"endif

:endper
_____________________________________________

Does anything here require the RPC service?

Top
#17016 - 2002-02-04 11:19 PM Re: HELP! Simple Mappings Don't Work
mdby22@hotmail.com Offline
Fresh Scripter

Registered: 2002-01-22
Posts: 19
Loc: Chicago
you guys the correct usage for the share should be

if ingroup("sharinfo-clients.isv.rsmt")
shell "%comspec% /e:1024 /c net use o: \\washington\clients"
endif

Top
#17017 - 2002-02-04 11:49 PM Re: HELP! Simple Mappings Don't Work
Anonymous
Unregistered


Why aren't we doing this in Kix?
Top
#17018 - 2002-02-05 12:03 AM Re: HELP! Simple Mappings Don't Work
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Some folks like to shell-out to NET USE instead of using the builtin USE command - i have to admit, im one of those folks.

-Shawn

Top
#17019 - 2002-02-05 12:38 AM Re: HELP! Simple Mappings Don't Work
mdby22@hotmail.com Offline
Fresh Scripter

Registered: 2002-01-22
Posts: 19
Loc: Chicago
Because I know it works :-) I get comfortable with what I get comfortable with all in all it works :-)
Top
#17020 - 2002-02-05 02:08 AM Re: HELP! Simple Mappings Don't Work
Anonymous
Unregistered


Can't argue with that.
Top
#17021 - 2002-02-05 03:18 AM Re: HELP! Simple Mappings Don't Work
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Shawn...Shawn,

Say it aint so Not the Top Poster of the board using EXTERNAL commands over INTERNAL commands.


I have and do use the internal USE on Thousands of systems from 95abc/98/98se/ME/NT/2K/XP and none of them has ever given me a problem mapping drives.

Please reconsider Shawn... be a purist where you can. I think Les would agree also.

{just a small jab there Shawn... you can shell if you want}

Top
#17022 - 2002-02-05 05:15 AM Re: HELP! Simple Mappings Don't Work
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Shawn, SHELLing out! tsk tsk tsk...
I thought you would have come up with a COM implementation instead. One that lets you customize the label at the same time.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#17023 - 2002-02-05 05:47 AM Re: HELP! Simple Mappings Don't Work
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
ask and ye shall recieve...
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#17024 - 2002-02-05 10:04 AM Re: HELP! Simple Mappings Don't Work
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Whazzup with ye ?

haven't used the shelled net use since we (Bryce and cj were involved iirc) ridled the use of USE even for 'no-drive-letter-ipc$-mappings' (There is nothing left that ain't work with USE !)

sample (as used as udf in my admin scripts):

code:

...
use "\\$Computer\$Share" /user:'$Domain\$User' /password:$Password
if @error = 0 or @error = 1219
exit(0)
else
exit(@error)
endif
...


J.

_________________________



Top
#17025 - 2002-02-05 03:19 PM Re: HELP! Simple Mappings Don't Work
mdby22@hotmail.com Offline
Fresh Scripter

Registered: 2002-01-22
Posts: 19
Loc: Chicago
Ok I am new
Who is the "Top Poster"
and I dont know a thing about UDFs or COMs this channel is for newbies so I use what I use to solve the problem until I learn the Newer better techniques.. So um what is UDF?

mdby22@hotmail.com

Top
#17026 - 2002-02-05 03:39 PM Re: HELP! Simple Mappings Don't Work
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Im the "Top Poster" around here. Which in itself doesn't say very much other than the fact that i tend to blab alot.

A UDF is a User Define Function, one of the new features of KiXtart 4.0 whereby one can define their own functions and use them just like any other bultin function, for example, if I wanted to create a function to add two numbers together, i would do this:

function add($n1,$n2)
$add = $n1+$n2
endfunction

place this anywhere in your script, then "call" it and bob's your uncle.

$answer = add(1,2)

-Shawn

Top
#17027 - 2002-02-05 04:31 PM Re: HELP! Simple Mappings Don't Work
Jochen Administrator Offline
KiX Supporter
*****

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

uh ... yes , sorry !
fergot we are on the starters side (that much new forums lately )

However ,
net use works , we all know that ; Only thing is trapping errors s(h)elling out something , therefore I prefer intrinsic commands/functions were they are available and work ..

never mind

J.

_________________________



Top
#17028 - 2002-02-06 03:01 AM Re: HELP! Simple Mappings Don't Work
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

FYI: internal commands are running must faster. Each SHELL and RUN command
creates his own virtual dos environment which slows down your script speed.


We agree with NTDOC that internal USE command works great.
Possible problems with (NET) USE can be:
persistent drive or already used drive
By internal command your script can be aborted. A RUN or SHELL command doesn't
have influence on your script, but by using RUN or SHELL you doesn't have
the capability to use the @error/@serror capability.
greetings.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#17029 - 2003-03-07 05:03 PM Re: HELP! Simple Mappings Don't Work
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
sure you can use error and serror.

they just don't show correct errors though.
_________________________
!

download KiXnet

Top
#17030 - 2003-03-07 05:45 PM Re: HELP! Simple Mappings Don't Work
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Jooel,
Dredging old posts now?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 2 12>


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

Who's Online
0 registered and 369 anonymous users online.
Newest Members
rrosell, PatrickPinto, Raoul, Timothy, Jojo67
17877 Registered Users

Generated in 0.113 seconds in which 0.078 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