Page 1 of 2 12>
Topic Options
#36629 - 2003-02-19 01:15 PM Problem launching script from batch file
Mike Brown Offline
Lurker

Registered: 2003-02-19
Posts: 2
Loc: UK
Hi,

Am trying to launch kixtart script from a batchfile, without success.

Netlogon structure:

\kix32 contains kixtart program
\uk contains script

calling using batchfile line:

%0\..\kix32\kix32.exe %0\..\uk\test.kix

but test.kix will not run unless I copy it to the root of the netlogon share.

Any ideas?

Thanks
_________________________
-- Mike

Top
#36630 - 2003-02-19 01:15 PM Re: Problem launching script from batch file
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Are the clients XP ?
_________________________



Top
#36631 - 2003-02-19 02:01 PM Re: Problem launching script from batch file
Mike Brown Offline
Lurker

Registered: 2003-02-19
Posts: 2
Loc: UK
No
_________________________
-- Mike

Top
#36632 - 2003-02-19 02:02 PM Re: Problem launching script from batch file
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
hmmmm ...
_________________________



Top
#36633 - 2003-02-19 02:04 PM Re: Problem launching script from batch file
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
What have you set to be the logon script in user mangler for domains ?

be aware that it is the best practice to place the batch directly in NETLOGON and state only the script name in the appropriate field (without any path statements !) ... speaking of NT

[ 19. February 2003, 14:05: Message edited by: jpols ]
_________________________



Top
#36634 - 2003-02-19 11:33 PM Re: Problem launching script from batch file
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
One might also want to use batch files, search the BBS for LOGIN.BAT, this will give you a couple of example batch files. There are also examples in the KiXtart Manual and the KiXtart Starter's Guide in the FAQ Forum.

[ 19. February 2003, 23:34: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#36635 - 2003-03-13 06:53 PM Re: Problem launching script from batch file
Anonymous
Unregistered


I too am having a problem calling Kixtart from my logon batch. I am testing this batch on my 2000/NT machines:
code:
  
rem NT/2000/XP KiXtart check for v. 4.02
If Exist %windir%\kix402.ok Goto bothOS
If Exist %windir%\kix32.exe Del %windir%\kix32.exe
If Exist %windir%\system32\kix32.exe Del %windir%\system32\kix32.exe
copy \\yeg01-nts-02\netlogon\tools\kix32.exe %windir%\. /Y > NUL
@echo KiXtart v402: installation completed > %windir%\kix402.ok
rem launch KiXtart interpreter for system logging info, registry setting, time sync
%windir%\kix32.exe \\yeg01-nts-02\netlogon\yeg05.kix

When I run the script, I get the failed to open script in the console window. Yet I can type this line at the command prompt and run the script???

Does anyone have a suggestion on this?

[this is just a snippet of the entire logon batch file, there is a "bothOS" tag later on in the script.]

[ 13. March 2003, 18:56: Message edited by: Kellar ]

Top
#36636 - 2003-03-13 07:03 PM Re: Problem launching script from batch file
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
First of all, please do not hijack a thread with an unrelated problem.

Secondly, the script will only work correctly if all users have local administrative privileges.

Login scripts have been discussed ad nauseum and standard examples scripts have been posted. Please use the KiXtart BBS Search to retrieve those threads.
_________________________
There are two types of vessels, submarines and targets.

Top
#36637 - 2003-03-13 07:25 PM Re: Problem launching script from batch file
Anonymous
Unregistered


I haven't found any threads in a hour that discuss being able to type the line in at the command prompt and have it work, and yet not have the identical line run in a batch file. I'll have another look before I post my own thread on this.
Top
#36638 - 2003-03-13 07:31 PM Re: Problem launching script from batch file
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
there actually is tons of posts about this for last 10 years.
faq forum has also example logon.bat

anyway, as short answer, change the calling line to:
%windir%\kix32.exe yeg05.kix

and it should work just fine with NT&w2k
_________________________
!

download KiXnet

Top
#36639 - 2003-03-13 07:56 PM Re: Problem launching script from batch file
Anonymous
Unregistered


Well I'll just have to dig through all those posts and see what I'm doing wrong. Thanks for the suggestions.
Top
#36640 - 2003-03-13 08:02 PM Re: Problem launching script from batch file
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
k, checked the faq.
see: http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=10;t=000025

it has pretty good example of logon.bat and it has lot of other good info.
_________________________
!

download KiXnet

Top
#36641 - 2003-03-13 10:16 PM Re: Problem launching script from batch file
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
rem NT/2000/XP KiXtart check for v. 4.02
If Exist %windir%\kix402.ok Goto bothOS problem no bothOS label to go to
If Exist %windir%\kix32.exe Del %windir%\kix32.exe problem user can read, but can't delete if not an Admin on 2000/XP
If Exist %windir%\system32\kix32.exe Del %windir%\system32\kix32.exe problem user can read, but can't delete if not an Admin on 2000/XP
copy \\yeg01-nts-02\netlogon\tools\kix32.exe %windir%\. /Y > NUL problem if user not Admin, can't write here on 2000/XP
@echo KiXtart v402: installation completed > %windir%\kix402.ok problem if user not Admin, can't write here on 2000/XP
rem launch KiXtart interpreter for system logging info, registry setting, time sync
%windir%\kix32.exe \\yeg01-nts-02\netlogon\yeg05.kix problem did not check if the file is there in %windir%, assumed it was there

This batch DOES NOT check if the user is an Admin either... but gives another example of how to copy the files locally.

@ECHO OFF
CLS
IF "%OS%" == "Windows_NT" GOTO Kix_WinNT
IF NOT "%OS%" == "Windows_NT" GOTO Kix_Win9X
:Kix_WinNT
IF EXIST %windir%\kix402.ok GOTO Server
ECHO Please wait... Updating the KiXtart program
ECHO files on your system. This may take a few minutes...
IF EXIST %windir%\kix32.exe DEL %windir%\kix32.exe
IF EXIST %windir%\kx95.dll DEL %windir%\kx95.dll
IF EXIST %windir%\kx16.dll DEL %windir%\kx16.dll
IF EXIST %windir%\kx32.dll DEL %windir%\kx32.dll
IF EXIST %windir%\system32\kix32.exe DEL %windir%\system32\kix32.exe
IF EXIST %windir%\system32\kx95.dll DEL %windir%\system32\kx95.dll
IF EXIST %windir%\system32\kx16.dll DEL %windir%\system32\kx16.dll
IF EXIST %windir%\system32\kx32.dll DEL %windir%\system32\kx32.dll
XCOPY %0\..\kix32.exe %windir%\. /H /I /R > NUL
@echo KiXtart v4.02: installation completed > %windir%\kix402.ok
GOTO Server
:Kix_Win9X
IF EXIST %windir%\kix402.ok GOTO Server
ECHO Please wait... Updating the KiXtart program
ECHO files on your system. This may take a few minutes...
IF EXIST %windir%\kix32.exe DEL %windir%\kix32.exe
IF EXIST %windir%\kx95.dll DEL %windir%\kx95.dll
IF EXIST %windir%\kx16.dll DEL %windir%\kx16.dll
IF EXIST %windir%\kx32.dll DEL %windir%\kx32.dll
IF EXIST %windir%\system\kx95.dll DEL %windir%\system\kx95.dll
IF EXIST %windir%\system\kx16.dll DEL %windir%\system\kx16.dll
IF EXIST %windir%\system\kx32.dll DEL %windir%\system\kx32.dll
XCOPY %0\..\kix32.exe %windir%\. /H /I /R > NUL
XCOPY %0\..\kx16.dll %windir%\system\. /H /I /R > NUL
XCOPY %0\..\kx32.dll %windir%\system\. /H /I /R > NUL
XCOPY %0\..\kx95.dll %windir%\system\. /H /I /R > NUL
@echo KiXtart v4.02: installation completed > %windir%\kix402.ok
:Server
@echo off
REM ** BEGIN CHECK FOR DIAL-UP CONNECTION **
:CHECK_RAS
CLS
echo Please wait - Network authentication is being verified . . .
ECHO.
IF EXIST %WINDIR%\CHECKRAS.EXE GOTO LOCAL
copy %0\..\CHECKRAS.EXE %WINDIR%
GOTO LOCAL

:LOCAL
%WINDIR%\CHECKRAS.EXE > nul
IF ERRORLEVEL 1 GOTO SLOW
GOTO NOT_RAS

:SLOW
echo Please wait - Network authentication is being verified . . .
echo.
%windir%\Kix32.exe %0\..\kix32.exe DIALIN.kix
GOTO END

REM ** END CHECK FOR DIAL-UP CONNECTION **

:NOT_RAS
GOTO KIX

:KIX
IF EXIST %windir%\Kix32.exe GOTO LOCALKIX
%0\..\kix32.exe %0\..\login.kix
GOTO END

:LOCALKIX
@ECHO OFF
IF NOT "%OS%" == "Windows_NT" GOTO LOCAL9X
%windir%\Kix32.exe %0\..\login.kix
GOTO END

:LOCAL9X
@ECHO OFF
IF EXIST %windir%\system\kx95.dll GOTO STEP1
%0\..\kix32.exe %0\..\login.kix
GOTO END

:STEP1
IF EXIST %windir%\system\kx16.dll GOTO STEP2
%0\..\kix32.exe %0\..\login.kix
GOTO END

:STEP2
IF EXIST %windir%\system32\kx32.dll GOTO STEP3
%0\..\kix32.exe %0\..\login.kix
GOTO END

:STEP3
IF EXIST %windir%\kix32.exe GOTO STEP4
%0\..\kix32.exe %0\..\login.kix
GOTO END

:STEP4
%windir%\Kix32.exe %0\..\login.kix
GOTO END

:END

Here is another example of determining OS from batch

@ECHO OFF
IF NOT "%OS%" == "Windows_NT" GOTO WIN9X
VER|FIND /I "XP" >NUL && IF %ERRORLEVEL% EQU 0 GOTO XP
IF not "%ALLUSERSPROFILE%" == "" GOTO WIN2K
IF "%OS%" == "Windows_NT" GOTO NT4
GOTO END
:XP
ECHO Found Windows XP
REM Or what ever command you want to run.
GOTO END
:WIN2K
ECHO Found Windows 2000
REM Or what ever command you want to run.
GOTO END
:NT4
ECHO Found Windows NT 4
REM Or what ever command you want to run.
GOTO END
:WIN9X
ECHO Found Windows 9x
REM Or what ever command you want to run.
GOTO END
:END

Top
#36642 - 2003-03-14 05:47 AM Re: Problem launching script from batch file
Anonymous
Unregistered


Thanks for the link Lonkero, I read the post in full.

NTDOC, I saw that script in some other post and used parts of it in my logon script. Not sure if you wrote it, thanks for passing it on just the same.

Since I am testing this script on my machine as admin., and I am sure that there is no problems that way. The problem that I have had from the outset still remains. This line:

%windir%\kix32.exe \\yeg01-nts-02\netlogon\yeg05.kix

can be typed from the command prompt in windows, and works fine. When I place this line in a batch file, I get a message that states that KiXtart cannot find or open the script...

Having said all that, I really do not want to post anymore in this thread as I'm pretty sure sealeopard is reading this andshaking his head at the fact that I'm still posting here and not following proper board etiquette by

a) doing a thorough search before posting and
b) not posting in an unrelated thread.

This is the first time I have tried calling a KiXtart script from a batch in NT/2000, and first time with 4.20. I'm sure I am overlooking a very small detail here; it'll take a little time to go through the suggestions presented here and look through the board for other posts. Thanks.

Top
#36643 - 2003-03-14 03:20 PM Re: Problem launching script from batch file
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
The folowing is a batch file to test your line:
code:
ECHO OFF
ECHO Content of the WINDIR environment variable
ECHO WINDIR = %WINDIR%
IF EXIST "%windir%\kix32.exe" ECHO Found "%windir%\kix32.exe"
IF NOT EXIST "%windir%\kix32.exe" ECHO Cannot find "%windir%\kix32.exe"
IF EXIST "\\yeg01-nts-02\netlogon\yeg05.kix" ECHO Found "\\yeg01-nts-02\netlogon\yeg05.kix"
IF NOT EXIST "\\yeg01-nts-02\netlogon\yeg05.kix" ECHO Cannot find "\\yeg01-nts-02\netlogon\yeg05.kix"
ECHO Calling "%windir%\kix32.exe" "\\yeg01-nts-02\netlogon\yeg05.kix"
PAUSE
%windir%\kix32.exe \\yeg01-nts-02\netlogon\yeg05.kix
ECHO Error %ERRORLEVEL%

Give it a try and report back.
_________________________
There are two types of vessels, submarines and targets.

Top
#36644 - 2003-03-14 05:16 PM Re: Problem launching script from batch file
Anonymous
Unregistered


Here is the output, it looks like it worked...

-----------------------------------------------
ECHO OFF
ECHO Content of the WINDIR environment variable
ECHO WINDIR = %WINDIR%
IF EXIST "%windir%\kix32.exe" ECHO Found "%windir%\kix32.exe"
IF NOT EXIST "%windir%\kix32.exe" ECHO Cannot find "%windir%\kix32.exe"
IF EXIST "\\yeg01-nts-02\netlogon\yeg05.kix" ECHO Found "\\yeg01-nts-02\netlogon\yeg05.kix"
IF NOT EXIST "\\yeg01-nts-02\netlogon\yeg05.kix" ECHO Cannot find "\\yeg01-nts-02\netlogon\yeg05.kix"
ECHO Calling "%windir%\kix32.exe" "\\yeg01-nts-02\netlogon\yeg05.kix"
PAUSE
%windir%\kix32.exe \\yeg01-nts-02\netlogon\yeg05.kix
ECHO Error %ERRORLEVEL%
-----------------------------------------------

Top
#36645 - 2003-03-14 05:18 PM Re: Problem launching script from batch file
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
I don't see any output, you just reposted the batch file. The output will be on the console!
_________________________
There are two types of vessels, submarines and targets.

Top
#36646 - 2003-03-14 05:32 PM Re: Problem launching script from batch file
Anonymous
Unregistered


Ooops! Here it is:

-------------------------------------------------
Content of the WINDIR environment variable WINDIR = C:\WINNT
Found "C:\WINNT\kix32.exe"
Found "\\yeg01-nts-02\netlogon\yeg05.kix"
Calling "C:\WINNT\kix32.exe" "\\yeg01-nts-02\netlogon\yeg05.kix"
Press any key to continue...
0Error 0
-------------------------------------------------

[Forgot to say thanks [Smile] ]

[ 14. March 2003, 18:07: Message edited by: Kellar ]

Top
#36647 - 2003-03-15 07:55 AM Re: Problem launching script from batch file
Anonymous
Unregistered


One final question: are you guys (the main posters) programmers? I was reading the latest KiXtart golf tournament lastnight and I can barely understand enough to interpret what I am reading.
Top
#36648 - 2003-03-15 08:07 AM Re: Problem launching script from batch file
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Some are programmers and other are self-taught out of necessity to support out environments and get a pay check.

Just started KixGolf to see if I could get an entry before 3PM.

[ 15. March 2003, 08:23: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

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 756 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.065 seconds in which 0.014 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