crivex
(Fresh Scripter)
2003-11-20 08:00 PM
logon script and .EXE

Hi all

I am trying to have a kix logon script run an executable independently from
the script itself. Which means that the kix script should launch the .EXE
and then continue with the other lines of the script.

I have tried to use RUN and SHELL but

If I use RUN like in:

RUN C:\MYEXECUTABLE.EXE

the script launches the exe but the exe is closed as soon as the kix script
ends! I want the exe to remain running even after the script ends.

If I use SHELL like in:

SHELL "CMD /C C:\MYEXECUTABLE.EXE"

the exe launches but the script then stops waiting for the exe window to be
closed! I want the script to continue past the line that launches the
executable.

Is this possible??

Thanks a lot!!!

crivex


AllenAdministrator
(KiX Supporter)
2003-11-20 08:29 PM
Re: logon script and .EXE

You definately want to use RUN in this circumstance...

Have you tried just running the EXE kinda like below?

Code:

? 'This is a test'
run 'notepad.exe'
? 'This is the end'
gets $



The code above runs notepad and when the script finishes, notepad is still running...


MCA
(KiX Supporter)
2003-11-20 08:56 PM
Re: logon script and .EXE

Dear,

We suggest to use somehting like

run '%comspec% /c notepad.exe

greetings.


crivex
(Fresh Scripter)
2003-11-20 09:14 PM
Re: logon script and .EXE

Hi

I have tried that with my exe ... but as soon as the script ends the executable is closed too!

I am lost....

crivex


MCA
(KiX Supporter)
2003-11-20 09:20 PM
Re: logon script and .EXE

Dear,

Which application you are trying to start?
Can you show you exact statement?
greetings.


crivex
(Fresh Scripter)
2003-11-21 12:26 AM
Re: logon script and .EXE

The application is a very simple executable that I made with VB 6. When excuted it just shows a form with some text that the user should read. The form has a click button that closes it. I would like that form to continue running (be displayed) even after the login script ends.

thanks again

crivex


ShawnAdministrator
(KiX Supporter)
2003-11-21 12:27 AM
Re: logon script and .EXE

Did you try AlPo's suggestion of doing:

run 'myapp.exe'

-Shawn



crivex
(Fresh Scripter)
2003-11-21 12:39 AM
Re: logon script and .EXE

Yes I did. When the script ends, the executable closes too.

???


ShawnAdministrator
(KiX Supporter)
2003-11-21 12:51 AM
Re: logon script and .EXE

well, i really don't understand that. I just created a little VB exe here - a simple form with a button on it, generated an EXE, ran it using RUN "project1.exe" and it worked just fine (didn't close) ... is there anything more you can tell us about anything unique to your situation or in this script or in this EXE ?


Les
(KiX Master)
2003-11-21 01:11 AM
Re: logon script and .EXE

We're not getting the whole story. What OS? Where is the EXE launched from? How is KiX launched?

Might be those damn wintendos and the Z: drive kludge.


crivex
(Fresh Scripter)
2003-11-21 01:13 AM
Re: logon script and .EXE

I tried to generate a new EXE... even that closes when the script ends. Please remember that this is a login script... it is run on a win2k professional box...

crivex
(Fresh Scripter)
2003-11-21 01:23 AM
Re: logon script and .EXE

The script is run on a Win2k Pro box that belongs to a Win2k domain. The user is set (group policy) to run a logon script (logon.bat) that does
%SYSTEMROOT%\KIX32.EXE %0\..\KIX\kixON.scr

The line

run C:\myexecutable.EXE

is the last line of KixON.scr

kixon.scr launches the EXE which immeaditely closes as the Kixon.scr ends being executed.

I don't understand what's going on...


ShawnAdministrator
(KiX Supporter)
2003-11-21 01:30 AM
Re: logon script and .EXE

No, didn't try it from a login script ... just by way of a test, what happens if you run NOTEPAD.EXE in the same way, does it close too ?

ShawnAdministrator
(KiX Supporter)
2003-11-21 01:40 AM
Re: logon script and .EXE

ok, crasping at straws now but I would try this only because you can and to say you did:

run '%comspec% /c start c:\project1.exe'

-Shawn


LonkeroAdministrator
(KiX Master Guru)
2003-11-21 08:32 AM
Re: logon script and .EXE

why not:
run 'start c:\project1.exe'



but I would not go there.
I would like to see him reply what happens to notepad if he fires it.
and what happens to his app if he launches the logonscript manually after logon.


crivex
(Fresh Scripter)
2003-11-21 03:55 PM
Re: logon script and .EXE

I have tried that too. No changes, the EXE closes when the script ends.

crivex
(Fresh Scripter)
2003-11-21 03:57 PM
Re: logon script and .EXE

Hi. The same thing happens with notepad. It closes when the script ends.

ShawnAdministrator
(KiX Supporter)
2003-11-21 04:40 PM
Re: logon script and .EXE

Is your Kixscript called from a batch file ? If yes (or if you could set one up temporarily), what happens if you put this line in the BAT file:

START NOTEPAD.EXE

-Shawn


AzzerShaw
(Seasoned Scripter)
2003-11-21 05:17 PM
Re: logon script and .EXE

This is similar to the problem with my script too that I never resolved.

using the examples given above by everyone, whenever I try to run anything at the end of my script by using the Run command, it always opens the appliaction but my script doesnt finish until I close the app. (the opposite of what Crivex is getting) Even happens when I use this example :
Code:
  
? 'This is a test'
run 'notepad.exe'
? 'This is the end'
gets $



Im using kix32 version 4.21.0.0 on an XP machine.


ShawnAdministrator
(KiX Supporter)
2003-11-21 05:27 PM
Re: logon script and .EXE

Are you running synchronous and asynchronous login scripts ?

AzzerShaw
(Seasoned Scripter)
2003-11-21 05:44 PM
Re: logon script and .EXE

How do you set that?

synchronous i believe cause everything is running at the same time. But as I said before even if I just did something like :
Code:
 

? "I cant wait to leave my workstation and go to the pub"
Run 'notepad.exe'
? "Please please stop running kix"



The script window will still appear and wont close unless I close down notepad


ShawnAdministrator
(KiX Supporter)
2003-11-21 05:53 PM
Re: logon script and .EXE

ja, i just tried the BAT file NOTEPAD thingy method in asynchronous login mode and NOTEPAD stayed long after the login script finished. So looks to be maybe this is a symptom of running the login synchronously ?

Les
(KiX Master)
2003-11-21 06:00 PM
Re: logon script and .EXE

Guys,
Don't lose sight of the fact the script is a GPO script not a legacy script, and AFAIK GPO scripts cannot be made to run sync.


ShawnAdministrator
(KiX Supporter)
2003-11-21 06:25 PM
Re: logon script and .EXE

I didn't forget Les, promise ... just missed the part where he said he's running GPO scripts ... so your saying it should work, unless there is something funky about GPO scripts running async ? Off-topic: Whats the big benefit of running GPO login scripts vs the old fashioned-kind ? User properties management headaches ?

-Shawn

[edit-btw]

Like my new color-coordinated avatar (at least in frosty-view)