Page 1 of 1 1
Topic Options
#12179 - 2001-09-07 10:01 PM I am almost done with this script...
Anonymous
Unregistered


I have been viewing several bb posts on Mapping and it seems to be an issue that is beat to death. I am having the same problem, but I have not been able to extract the information from the postings I have read to make the N: and the O: drive mappings in my script run. My goal is to get rid of several scripts and just have one. If anyone could help, I would greatly appreciate it.

Here is the environment and 2 sections of the code I am working with…

Server: Win2k
Clients: Win2k
KIX: 2001
$ServerName = \\mdch-ds1

code:
 ;*********************** Initialization ***********************

? "Processing Logon Script for @USERID..."

SETCONSOLE ("HIDE") = 0

$ServerName = "\\MDCH-DS1"

USE * /delete

;****************** Map Network Directories *******************

? ? "Mapping Department Directory to N:\..."
? "Mapping Personal Directory to O:\..."

SELECT

CASE INGROUP ("Financial")
USE N: "$ServerName\Financial"
USE O: "$ServerName\Financial\@USERID"
USE P: "$ServerName\Financial\" + @USERID
? " Connected to FINANCIAL!"
GOTO FINISH

CASE INGROUP ("Human Resources")
USE N: "$ServerName\Human Resources"
USE O: "$ServerName\Human Resources\@USERID"
? " Connected to FINANCIAL!"
GOTO FINISH

CASE INGROUP ("Information Systems")
USE N: "$ServerName\Information Systems"
USE O: "$ServerName\Information Systems\@USERID"
? " Connected to INFORMATION SYSTEMS!"
GOTO FINISH

CASE INGROUP ("Secretaries & Assistants")
USE N: "$ServerName\Secretaries & Assistants"
USE O: "$ServerName\Secretaries & Assistants\" + @USERID
? " Connected to SECRETARIES & ASSISTANTS!"
GOTO FINISH

CASE 1
BEEP
SETCONSOLE ("MAXIMIZE") = 0
? " Unrecognized Group, NO DRIVES MAPPED!"
? ? "Please Contact Thomas Michaels At x5010 For Help!"
SLEEP 5
GOTO FINISH

ENDSELECT



Notice that I have also tried several uses of the @userid command to try to get it to work. All the shares I am trying to connect to are already setup and the folders for each user are also setup. I’m sooo close and I’d like to be able to put my script into production this coming week. The N: or the O: drives aren’t mapping and I can’t figure it out. Also, how do I check the @error and @serror macros to see the errors?

Here is the output I receive from running the script. Notice that there are two ‘1’s that show up (I bolded them)…

quote:
Processing Log In Script for Test1

Checking Administrator Access...
Administrator Access DENIED!

Checking Quick Books Access...
Quick Books Access GRANTED!

Mapping Department Directory to N:\...
Mapping Personal Directory to O:\...1
Unrecognized Group, NO DRIVES MAPPED!

Please Contact Thomas Michaels At x5010 For Help!

Your Logon Script is Complete...


Wow...I never knew scripting could get so involved, but I look forward to future!

[ 07 September 2001: Message edited by: Thomas A. Michaels ]

Top
#12180 - 2001-09-08 01:15 AM Re: I am almost done with this script...
JensKalski Offline
Starting to like KiXtart

Registered: 2000-12-13
Posts: 186
Loc: Germany
Hi Thomas,
first I think that you should take again a look in the doc for SetConsole. It is a function. The two 1s you get are from the comparison
code:
SETCONSOLE ("HIDE") = 0


you better test a row like
code:
$OK = SETCONSOLE("HIDE")

Your problem with the ingroup can be that you are using Kix2001 in a domain. You should test like

code:
case InGroup("domainname\groupname")


if it is a domain global group.

I hope this help.

_________________________
Jens Kalski

Top
#12181 - 2001-09-10 04:54 PM Re: I am almost done with this script...
Anonymous
Unregistered


Using $ok in front of the set console variable took care of the misc. 1's floating around in my script.

I still am having a problem with Drive Mappings though. I tried the Domain\ in front of the group names and that did not work. I am stuck!

I've tried several ways and don't know what to do.

Top
#12182 - 2001-09-10 11:16 PM Re: I am almost done with this script...
Alex.H Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 406
Loc: France
The second 1 is the second setconsole at the case 1
Use this instead :
$=SETCONSOLE ("MAXIMIZE")

You don't need a goto finish after the case statement. From the Kix Help :
"Only one CASE statement is executed, regardless of how many statements evaluate to TRUE."
In fact, the first true statement is executed, and goes directly to endselect

I ran this script @home and it work perfectly (w2k station). Dunno what hang here.

_________________________
? getobject(Kixtart.org.Signature)

Top
#12183 - 2001-10-22 04:18 AM Re: I am almost done with this script...
MCA Offline
KiX Supporter
*****

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

We have add some debug code to your script, which will show
- which lines were executed
- what was the time of execution
- what was the error status
Also we had made some changes. A short list of it:

  • we replace line.12 by line.9 - line.11.
    we remove the drive mapping N:, O: and P: by name.
    possible you have a problem with the use * /delete call by
    persistent mappings.
  • we remove the goto finish statement in your SELECT/CASE/ENDSELECT
    structure. After the ENDSELECT we add this GOTO statement again (line.43)
    it is only a cosmetic change.

Please this code and the file c:\kix-info.log will contain above
information.
Please put the result of this c:\kix-info.log file on the board, when
you have still a problem.

code:

CLS
COLOR C+/N
AT (1,1) " "
IF RedirectOutput("")
ENDIF
? "-"+@date+" "+@time+"- Script "+@kix+" starting."
?"- 1-"+@time+"- @error @serror "?
?"- 2-"+@time+"- @error @serror "? ;*********************** Initialization ***********************
?"- 3-"+@time+"- @error @serror "? ? "Processing Logon Script for @USERID..."
?"- 4-"+@time+"- @error @serror "? IF (SETCONSOLE ("HIDE") <> 0)
?"- 5-"+@time+"- @error @serror "? ENDIF
?"- 6-"+@time+"- @error @serror "?
?"- 7-"+@time+"- @error @serror "? $servername = "\\MDCH-DS1"
?"- 8-"+@time+"- @error @serror "? ;******************* delete persistent drive ******************
?"- 9-"+@time+"- @error @serror "? USE N: /delete
?"- 10-"+@time+"- @error @serror "? USE O: /delete
?"- 11-"+@time+"- @error @serror "? USE P: /delete
?"- 12-"+@time+"- @error @serror "? ; USE * /delete
?"- 13-"+@time+"- @error @serror "? ;****************** Map Network Directories *******************
?"- 14-"+@time+"- @error @serror "? ?
?"- 15-"+@time+"- @error @serror "? ? "Mapping Department Directory to N:\..."
?"- 16-"+@time+"- @error @serror "? ? "Mapping Personal Directory to O:\..."
?"- 17-"+@time+"- @error @serror "? SELECT
?"- 18-"+@time+"- @error @serror "? CASE
INGROUP ("Financial")
?"- 19-"+@time+"- @error @serror "? USE N: "$ServerName\Financial"
?"- 20-"+@time+"- @error @serror "? USE O: "$ServerName\Financial\@USERID"
?"- 21-"+@time+"- @error @serror "? USE P: "$ServerName\Financial\" + @userid
?"- 22-"+@time+"- @error @serror "? ? " Connected to FINANCIAL!"
?"- 23-"+@time+"- @error @serror "? CASE
INGROUP ("Human Resources")
?"- 24-"+@time+"- @error @serror "? USE N: "$ServerName\Human Resources"
?"- 25-"+@time+"- @error @serror "? USE O: "$ServerName\Human Resources\@USERID"
?"- 26-"+@time+"- @error @serror "? ? " Connected to FINANCIAL!"
?"- 27-"+@time+"- @error @serror "? CASE
INGROUP ("Information Systems")
?"- 28-"+@time+"- @error @serror "? USE N: "$ServerName\Information Systems"
?"- 29-"+@time+"- @error @serror "? USE O: "$ServerName\Information Systems\@USERID"
?"- 30-"+@time+"- @error @serror "? ? " Connected to INFORMATION SYSTEMS!"
?"- 31-"+@time+"- @error @serror "? CASE
INGROUP ("Secretaries & Assistants")
?"- 32-"+@time+"- @error @serror "? USE N: "$ServerName\Secretaries & Assistants"
?"- 33-"+@time+"- @error @serror "? USE O: "$ServerName\Secretaries & Assistants\" + @userid
?"- 34-"+@time+"- @error @serror "? ? " Connected to SECRETARIES & ASSISTANTS!"
?"- 35-"+@time+"- @error @serror "? CASE
1
?"- 36-"+@time+"- @error @serror "? BEEP
?"- 37-"+@time+"- @error @serror "? SETCONSOLE ("MAXIMIZE") = 0
?"- 38-"+@time+"- @error @serror "? ? " Unrecognized Group, NO DRIVES MAPPED!"
?"- 39-"+@time+"- @error @serror "? ?
?"- 40-"+@time+"- @error @serror "? ? "Please Contact Thomas Michaels At x5010 For Help!"
?"- 41-"+@time+"- @error @serror "? SLEEP 5
?"- 42-"+@time+"- @error @serror "? ENDSELECT
?"- 43-"+@time+"- @error @serror "? GOTO finish


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
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 837 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

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