Page 1 of 1 1
Topic Options
#95068 - 2002-11-01 02:46 AM RUN & RunLogonScriptSync
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
There are times when one may want to execute an external program from the logon script. The desire being that the previously mentioned external program RUNs independently from the KiXtart logon script process. Well we know that SHELL is not the what we want, but RUN seems like the ticket. So...RUN is used to launch SMSLS.BAT.

What I have experienced with 4.02 on W2K is:

Shell work great but the logon script can be delayed during the execution of the SMSLS.BAT and related code as expected.

When RUN is used the KiXtart logon script console, sometimes remains after the logon script finishes. The logfile records that the KiXtart script code ends and the last line of the batch file used to call the Kix code executes. When this happens the window can not be closed of course.

So I added some additional code that I expected would better isolate the executing external program: Run | Shell '%comspec% /c Start ... SMSLS.BAT'. In both cases, the START command will leave a new console window open after SMSLS finishes. No big deal I thought. We can add an EXIT to the SMSLS.BAT file. But what really concerned me was that when SMSLS took a while to execute the LOGON script window remained until the DOS prompt appeared in the SMSLS window thus holding up the loading of the desktop.

That would seem to indicate that any program executed from the logon script has to complete before KiXtart or the "LOGON" session can terminate.

If that is the case, is there any REAL value to using RUN?

Does anyone know a way to truly spawn an independent process from the logon script other than using the RUNONCE key?

Is this KiXtart or the RunLogonScriptSync value that is the true culprit?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#95069 - 2002-11-01 02:57 AM Re: RUN & RunLogonScriptSync
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I have not noticed any significant delay with smsls.bat, but I call it from my logon.bat (last line before EXIT) instead of from KiX.

Call %0\..\smsls.bat

(I know about %0\.. and XP but have no XP)
I would expect that RunLogonScriptSync would hold it until it completes.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#95070 - 2002-11-01 03:15 PM Re: RUN & RunLogonScriptSync
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
I've been using a
code:
CLS
EXIT 0

at the end of my login batch files. This normally solved the problem of a non-closing batch file. Give it a try.
_________________________
There are two types of vessels, submarines and targets.

Top
#95071 - 2002-11-01 03:40 PM Re: RUN & RunLogonScriptSync
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Howard,
Have you tried doing without the SMSLS.BAT, that is to duplicate what it does in KiX and to RUN the SNBOOT.EXE or SMSBOOT1.EXE instead?

Also, how do you call KiX?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#95072 - 2002-11-01 04:05 PM Re: RUN & RunLogonScriptSync
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
sealeopard, I have added the exit and will see if that shows a noticable different.

LLigetfa, I have discussed that with the SMS team, but they wanted to keep it separate incase they wanted to adjust it in some fashion. With it separate, there would not be any need to alter the Kix code.

Although I typed a bunch of crap in my original post, the real point of what I would like to discuss is the observed issue that the logon script window WAITED for the "%comspec% /c START SMSLS.BAT" to finish before the window closed.

In case anyone is interested, this is my batch file.
code:
@ECHO OFF

:: Set environment variables
SET A=CRC:
SET C=Xcopy
SET D=Xcopy ERROR:
SET L=%Temp%\Logon.log
SET C1=CRC32.exe
SET K1=kix32.exe
SET KixPath=%0\..\kix32\402
SET UtilPath=%0\..\utils
SET COPYCMD=/Y
SET CORPRUN=-prd
SET LOCALRUN=-prd
if EXIST %windir%\corp.tst SET CORPRUN=-tst
if EXIST %windir%\local.tst SET LOCALRUN=-tst

echo Start logon script batch file >%L%
echo.

:: Determine OS
IF '%OS%'=='Windows_NT' GOTO WinNT

SET windir=
SET windir=
IF '%windir%'=='' SET OS=DOS
IF '%OS%'=='' IF '%windir%'=='' SET OS=Windows_3.x
IF '%OS%'=='' SET OS=Win9x
IF '%OS%'=='Win9x' GOTO Cont

echo DOS and Windows 3.x are not supported!
pause
goto End

:WinNT
date<nul >>%L%
echo. >>%L%
time<nul >>%L%
echo. >>%L%
echo PROCESSOR_ARCHITECTURE=%PROCESSOR_ARCHITECTURE% >>%L%
IF NOT '%PROCESSOR_ARCHITECTURE%'=='x86' Echo Only x86 Architecture is supported. >>%L%
IF NOT '%PROCESSOR_ARCHITECTURE%'=='x86' GOTO End

:Cont

Set G=%Temp%
IF '%OS%'=='Win9x' Set G=%windir=%

:: Perform CRC check of CRC32.exe, replace file if necessary
echo. >>%L%
set F=%C1%
if NOT EXIST %G%\%C1% %C% %UtilPath%\%F% %G%\ >>%L%
echo %A% %G%\%F% >>%L%
%G%\%C1% -v 40960 17930e8e %G%\%F% >>%L%
if errorlevel 1 echo %A% %C% %UtilPath%\%F% %G%\ >>%L%
if errorlevel 1 %C% %UtilPath%\%F% %G%\ >>%L%
if errorlevel 1 echo %D% %errorlevel% >>%L%
echo. >>%L%

:: Perform CRC check of Kix32.exe, replace file if necessary
set F=%K1%
echo %A% %G%\%F% >>%L%
%G%\%C1% -v 204800 aff4a2b9 %G%\%F% >>%L%
if errorlevel 1 echo %A% %C% %KixPath%\%F% %G%\ >>%L%
if errorlevel 1 %C% %KixPath%\%F% %G%\ >>%L%
if errorlevel 1 echo %D% %errorlevel% >>%L%
echo. >>%L%

IF '%OS%'=='Win9x' GOTO Win9x
goto Exec

:Win9x
SET F=kx16.dll
echo %A% %G%\%F% >>%L%
%G%\%C1% -v 47104 9777a905 %G%\%F% >>%L%
if errorlevel 1 echo %A% %C% %KixPath%\%F% %G%\ >>%L%
if errorlevel 1 %C% %KixPath%\%F% %G%\ >>%L%
if errorlevel 1 echo %D% %errorlevel% >>%L%
echo. >>%L%

SET F=kx32.dll
echo %A% %G%\%F% >>%L%
%G%\%C1% -v 49152 98fb4015 %G%\%F% >>%L%
if errorlevel 1 echo %A% %C% %KixPath%\%F% %G%\ >>%L%
if errorlevel 1 %C% %KixPath%\%F% %G%\ >>%L%
if errorlevel 1 echo %D% %errorlevel% >>%L%
echo. >>%L%

SET F=kx95.dll
echo %A% %G%\%F% >>%L%
%G%\%C1% -v 49152 61cd8e0f %G%\%F% >>%L%
if errorlevel 1 echo %A% %C% %KixPath%\%F% %G%\ >>%L%
if errorlevel 1 %C% %KixPath%\%F% %G%\ >>%L%
if errorlevel 1 echo %D% %errorlevel% >>%L%
echo. >>%L%

:Exec
SET F=Libr%CORPRUN%.kix
echo %A% %G%\%F% >>%L%
%G%\%C1% -v 19692 4d1ac46f %G%\%F% >>%L%
if errorlevel 1 echo %A% %C% %0\..\%F% %G%\ >>%L%
if errorlevel 1 %C% %0\..\%F% %G%\ >>%L%
if errorlevel 1 echo %D% %errorlevel% >>%L%
echo. >>%L%

SET F=Corp%CORPRUN%.kix
echo %A% %G%\%F% >>%L%
%G%\%C1% -v 30764 3834ce70 %G%\%F% >>%L%
if errorlevel 1 echo %A% %C% %0\..\%F% %G%\ >>%L%
if errorlevel 1 %C% %0\..\%F% %G%\ >>%L%
if errorlevel 1 echo %D% %errorlevel% >>%L%
echo. >>%L%

echo %G%\%K1% %0\..\boot%CORPRUN%.kix $Script=corp $SPath=%G% >>%L%
%G%\%K1% %0\..\boot%CORPRUN%.kix $Script=corp $SPath=%G%

:END
echo End of corp-prd.bat >>%L%
SET A=
SET C=
SET D=
SET F=
SET G=
SET L=
SET C1=
SET K1=
SET KixPath=
SET UtilPath=
SET COPYCMD=
SET CORPRUN=
SET LOCALRUN=
cls
Exit 0

_________________________
Home page: http://www.kixhelp.com/hb/

Top
#95073 - 2002-11-01 04:45 PM Re: RUN & RunLogonScriptSync
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I beginning to understand that SMS is just a case in point.

Without putting a whole lot of thought and research into this, let me toss out some brain farts:

RunLogonScriptSync will hold until the script completes. I think any 16bit programs invoked, whether by Shell or Run, will hold it up as well.

I wonder if the Start option to run in separate memory space may have some bearing. I think the WOWExec by default keeps them as one.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#95074 - 2002-11-01 09:14 PM Re: RUN & RunLogonScriptSync
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Jens, using RUN SMSLS.BAT and the "Exit 0" at the end of my batch file still leaves the logonscript console at times.

I have never had this problem when the script used SHELL instead of RUN.

Thoughts on the RUN issue?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
Page 1 of 1 1


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

Who's Online
0 registered and 1376 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.035 seconds in which 0.015 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