Page 1 of 2 12>
Topic Options
#181757 - 2007-10-18 05:29 PM script runs, but use command gives error
rawsonm Offline
Fresh Scripter

Registered: 2007-10-18
Posts: 6
Hello

I have a script at work that I am using on my church 2003 Advance server. Everything seems to work, but the ingroup or use command gives an error and the script fails.

These are xp workstations that are members of the domain and I am logged into the PC into the domain using an admin level user account. The kix files are in the netlogon area, and I have added the kix32.exe to the users profile setting on the AD users and computers setting for the users account.

From what I understand there is nothing to put on the XP pc and that I only need to dump the script and the kix files onto the netlogon folder.

What did I miss? I am running the most recent version of of the kix program from the web site.

thanks
mark

Top
#181761 - 2007-10-18 07:21 PM Re: script runs, but use command gives error [Re: rawsonm]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11559
Loc: CA
What version of KiX and what error?

The only file needed is either KIX32.EXE or WKIX32.EXE for NT/2000/XP/2003/Vista

Top
#181763 - 2007-10-18 07:34 PM Re: script runs, but use command gives error [Re: NTDOC]
noobness Offline
Fresh Scripter

Registered: 2006-01-05
Posts: 32
Need to have the kix exe files plus the kix script in the sysvol (netlogon) and create a batch file that calls 'kix32.exe script.kix'. the batch file would be under the user account logon script in active directory. Pretty sure this is all in the manual.

JD

Top
#181765 - 2007-10-18 07:39 PM Re: script runs, but use command gives error [Re: noobness]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4257
Loc: New Jersey
Batch file is not necessary.

If your script name is anything other than "kixtart.kix", you need to define both the Kix32.exe and the script name in your user's Logon Script profile setting. ie: kix32.exe logon.kix

I use this to great advantage - my profile contains "kix32.exe kixtart_test.kix", while everyone else's profile simply contains "kix32.exe". When I make changes to the login script, it is pushed out as "kixtart_test.kix", and it only works for me. When it passes testing, I copy it to "kixtart.kix" and everyone gets the new version.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#181785 - 2007-10-19 05:58 PM Re: script runs, but use command gives error [Re: Glenn Barnas]
rawsonm Offline
Fresh Scripter

Registered: 2007-10-18
Posts: 6
Hello

I am using the kix 2010 4.53.

On the server netlogon, I have the files, the scipt. For the users profile in AD, I have kix32.exe for the profile.

It does run, but when it gets to the ingroup, or use command for mappings, it stops with some error that I can not see on the screen.

How do I create a log of what is going on?

This is the same script that I have at work and it works fine. the shares are setup, and I can get to them outside of the script. It just seems like the script/process/xp does not know what the use command is.

Where is the use command kept? Is that part of the kix program?

thanks
mark

Top
#181788 - 2007-10-19 07:02 PM Re: script runs, but use command gives error [Re: rawsonm]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Maybe put something in your script like:
 Code:
Sleep 10 ;script waits for 10 seconds
Get $RC ;script waits for input of one char and puts it in variable $RC
It maybe gives you time to read the message.

Maybe you can post your code?

Top
#181793 - 2007-10-19 08:27 PM Re: script runs, but use command gives error [Re: Witto]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
And yes USE is a built in command of KiX
_________________________
Today is the tomorrow you worried about yesterday.

Top
#181795 - 2007-10-19 08:55 PM Re: script runs, but use command gives error [Re: rawsonm]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4257
Loc: New Jersey
After each command in question, add:
LMsg('ID', @ERROR, @SERROR)

"ID" should be something that describes the point in your script, like "Line 97".

Then add the LMsg() UDF to your script:
 Code:
Function LMsg($ID, $Err, $SErr)

  Dim $_

  $_ = RedirectOutput('C:\LoginErr.txt')
  'Error ' $Err ' occured at ' $ID ?
  '  ' $SErr ? ?
  $_ = RedirectOutput('')
  Exit $Err  ; exit with same error so @ERROR is not modified by this func
EndFunction


Run your code, then examine C:\LoginErr.log to see what happened. If the log is empty, the cause is bad coding - Kix is throwing an error that is terminating the script at the point of error. You could add a RedirectOutput to the beginning of the script, so all output, including Kix fatal errors, will be in the log. Also, you can try Kix 4.6, which will write fatal errors to the application event log.

Glenn



_________________________
Actually I am a Rocket Scientist! \:D

Top
#181853 - 2007-10-23 01:24 PM Re: script runs, but use command gives error [Re: Glenn Barnas]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4945
Loc: Leatherhead, Surrey, UK
Have you tried opening a DOS prompt and running the script manually? If the script is abending then you will see the error(s).

If the script runs OK then the error is probably related to the way that you are calling the script.

If your script does not contain sensitive information then post it here for review - sometimes it just needs another set of eyes to look at the problem.

Top
#181855 - 2007-10-23 01:38 PM Re: script runs, but use command gives error [Re: Richard H.]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1850
Loc: Hilversum, The Netherlands
Is it just me who finds this part interesting "church 2003 Advance server"

- A Church having a server.
- 2003 Advanced Server ? Either 2003 Standard/Web/Enterprise/Datacenter or 2000 Advanced server.
- Church 2003 Advanced Server isn't any OS I've ever heard of, then again I'm not much into religion anyway ;\)

Top
#181856 - 2007-10-23 01:41 PM Re: script runs, but use command gives error [Re: Richard H.]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4257
Loc: New Jersey
Richard!!

DOS prompt? You of all people should know that the last DOS prompt went extinct with the death of WinTyrantSoreUs-Doze98! \:o Even though the species attempted to survive the new millenium, the offspring was weak and did not survive.

Other than that, I'd do pretty much the same thing, except I'd use the COMMAND prompt. ;\)

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#181875 - 2007-10-23 11:11 PM Re: script runs, but use command gives error [Re: Glenn Barnas]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11559
Loc: CA
Well it's not a COMMAND "promp" either it's a "command interpreter" that has an underlying PIF entry that defaults to "Command Prompt" but could be named anything. ;\)
Top
#181880 - 2007-10-24 04:22 AM Re: script runs, but use command gives error [Re: NTDOC]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4257
Loc: New Jersey
Yeah, yeah, whatever, just don't call it "DOS"! ;\)
_________________________
Actually I am a Rocket Scientist! \:D

Top
#181885 - 2007-10-24 09:21 AM Re: script runs, but use command gives error [Re: Glenn Barnas]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11559
Loc: CA
LOL - Okay boss, I hear ya - but to be honest most people understand or know what you mean even if they're on Linux when you call it a DOS Prompt.
Top
#181887 - 2007-10-24 09:50 AM Re: script runs, but use command gives error [Re: NTDOC]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1850
Loc: Hilversum, The Netherlands
Or just command.com ;\)
Then again there is DosBox.exe that emulates true dos... \:\)

Top
#181902 - 2007-10-24 03:21 PM Re: script runs, but use command gives error [Re: Arend_]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
 Code:
Open 8,1 "testfile"
_________________________
Today is the tomorrow you worried about yesterday.

Top
#181986 - 2007-10-26 03:32 PM Re: script runs, but use command gives error [Re: Glenn Barnas]
rawsonm Offline
Fresh Scripter

Registered: 2007-10-18
Posts: 6
Hello Glenn

thanks for the great code, I will test this weekend. For people that were asking, no there is not a church version of the OS, I am working on this issue at my church. The software is Windows 2003 advanced server.

For anyone that wanted to see the code, here it is. As stated before, I am using the exact same code at work with no problems.

As stated before, I am calling with with a kix32.exe in the users AD profile for login script.

thanks for all the great comments and help.

mark


Attachments
kixtart.kix (108 downloads)
Description:



Top
#182001 - 2007-10-26 07:16 PM Re: script runs, but use command gives error [Re: rawsonm]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11559
Loc: CA
Think the guys were joking with you a bit. There is no "Windows 2003 advanced server"

The basic versions of Server 2003 are:
  • Standard Edition
  • Enterprise Edition
  • Datacenter Edition
  • Web Edition


Now they're doing R2 versions and Server 2008 is just around the corner.

Will take a look at your code and see if I see anything obvious. I see 3 others have downloaded it as well.

Top
#182002 - 2007-10-26 07:36 PM Re: script runs, but use command gives error [Re: rawsonm]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11559
Loc: CA
Okay, here is your script and my comments. Though no issues for why it would not run (might not be the best but should still run)

Does the console come up and in a Maximum state for the user when they logon or nothing happens?

 Code:
If Not @LogonMode
  Break On
Else
  Break Off
EndIf
CLS
Dim $SO
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
$SO=SetOption('NoMacrosInStrings','On')
$SO=SetOption('WrapAtEOL','On')
$SO=SetTitle('Church Login Script')
$SO=SetConsole('maximize')
Dim $x

;Should add either the name of the Domain or the macro for current Domain
If InGroup(@Domain+'\church_admin')
    use L: /delete /persistent
    use M: /delete /persistent

	;Really don't see the need for setting it persistent if you're 
    ;going to map it every logon and delete it every logon
    ;(yes parameter not needed)
    use L: \\bcbkup01\avfoldera /persistent
    use M: \\bcbkup01\avfolderb /persistent
EndIf

If InGroup(@Domain+\'churchusers')
    use J: /delete
    use J: "\\bcbkup01\images" /persistent
EndIf
;No need to clear screen again as you have not shown anything yet
cls

Color r+/n

small
Color R+/n
BOX (0,0,24,79,GRID)            ; 'background grid'
Color b/n
BOX (8,21,18,61,)              ; 'shadow' of the box
Color g+/n
BOX (7,20,17,60,FULL)

Color w+/n
AT ( 9,25) "Userid       : "    ; display some text strings
AT (10,25) "Full name    : "
AT (11,25) "Privilege    : "
AT (12,25) "Workstation  : "
AT (13,25) "Domain       : "
AT (14,25) "Logon Server : "

Color y+/n
AT ( 9,40) @userid              ; ...and some macro's
AT (10,40) @fullname
AT (11,40) @priv
AT (12,40) @wksta
AT (13,40) @domain
AT (14,40) @lserver

Color w/n
sleep 2

cls
;Should be in quotes and should be in the NETLOGON share
Display 'message.txt'

sleep 2

cls

;Do not see why this is here, you do not seem to use it for anything
$x = SubStr(@ipaddress0,7,1)

If Open(3 ,'\\bcbkup01\log\log.txt' ,5) = 0
	$x = WriteLine(3,"User:  " + @fullname + "  " + @userid + "  " + @wksta  +"  Logged on  " + @date + "   " + @time + "   " + @ipaddress0  +@CRLF)
Else
	? "Failed to open file, error code : [" + @error + "]"
EndIf

;Need to sleep or something otherwise if you want to show this error 
;otherwise the user will not have time to see it
Sleep 3
cls
;What is in this timeset.cmd file?  On an Active Directory you should
;not be setting the time as it is automated now days
;Regardless you should also run it with comspec
; Shell '%comspec% /c \\churchdomain\netlogon\timeset.cmd '
shell "\\churchdomain\netlogon\timeset.cmd"

;You should either provide an @ERROR exit or a given exit code 
exit


Top
#182005 - 2007-10-26 07:45 PM Re: script runs, but use command gives error [Re: NTDOC]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
I would wrap strings in quotes like documented in kix2010.doc
 Code:
use "L:" "\\bcbkup01\avfoldera" /persistent

Top
Page 1 of 2 12>


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

Who's Online
1 registered (KevinOfOz) and 155 anonymous users online.
Newest Members
phanhuyen345, msmile032, bellamabel2018, lmnopq098068, nathanjame
17561 Registered Users

Generated in 0.041 seconds in which 0.011 seconds were spent on a total of 15 queries. Zlib compression enabled.

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