#181757 - 2007-10-18 05:29 PM
script runs, but use command gives error
|
rawsonm
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
|
|
|
|
#181785 - 2007-10-19 05:58 PM
Re: script runs, but use command gives error
[Re: Glenn Barnas]
|
rawsonm
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
MM club member
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
Maybe put something in your script like: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
|
|
|
|
#181795 - 2007-10-19 08:55 PM
Re: script runs, but use command gives error
[Re: rawsonm]
|
Glenn Barnas
KiX Supporter
Registered: 2003-01-28
Posts: 4396
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:
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!
|
Top
|
|
|
|
#181855 - 2007-10-23 01:38 PM
Re: script runs, but use command gives error
[Re: Richard H.]
|
Arend_
MM club member
Registered: 2005-01-17
Posts: 1894
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
|
|
|
|
#181875 - 2007-10-23 11:11 PM
Re: script runs, but use command gives error
[Re: Glenn Barnas]
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11623
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
|
|
|
|
#181885 - 2007-10-24 09:21 AM
Re: script runs, but use command gives error
[Re: Glenn Barnas]
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11623
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_
MM club member
Registered: 2005-01-17
Posts: 1894
Loc: Hilversum, The Netherlands
|
Or just command.com Then again there is DosBox.exe that emulates true dos...
|
Top
|
|
|
|
#181986 - 2007-10-26 03:32 PM
Re: script runs, but use command gives error
[Re: Glenn Barnas]
|
rawsonm
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 (439 downloads) Description:
|
Top
|
|
|
|
#182001 - 2007-10-26 07:16 PM
Re: script runs, but use command gives error
[Re: rawsonm]
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11623
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
Registered: 2000-07-28
Posts: 11623
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?
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
MM club member
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
I would wrap strings in quotes like documented in kix2010.doc
use "L:" "\\bcbkup01\avfoldera" /persistent
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 259 anonymous users online.
|
|
|