Page 1 of 1 1
Topic Options
#46289 - 2003-10-04 12:43 AM Shutting an application down..
KnownOversight Offline
Lurker

Registered: 2003-10-03
Posts: 3
Loc: London
[Confused]
I'm new to kix scripting, so there's probably a very simple answer to this.

Background:
I've written the following simple script -
WRITEPROFILESTRING ("C:\windows\GSS.INI" ,"LAN" , "User ID" , @USERID)
..which is followed (in a batch file) by calling a network exe to start the application that uses the above ini file.

Problem:
When the program launched from the batch file it leaves a dos box in the background which will confuse my rather simple users...

Question:
Is there a way, in a kix script not a batch file, to launch the application, maybe sleep for 2 seconds and shut down the dos box with out shuting down the application?

Thanks for any suggestions

Top
#46290 - 2003-10-03 01:16 PM Re: Shutting an application down..
KnownOversight Offline
Lurker

Registered: 2003-10-03
Posts: 3
Loc: London
[Big Grin] [Big Grin]
I've actually just figured this out myself.
If you call the application from within the script, doing away with the need of a batch file, create a shortcut with the following command line;
c:\windows\wkix32.exe -i kixscript.kix
.. instead of;
c:\windows\kix32.exe kixscript.kix
..the script will run in invisible mode and not cause a problem.

This is probably really obvious for seasoned kixtarters...

Top
#46291 - 2003-10-03 04:03 PM Re: Shutting an application down..
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, does the program produce the box or kixtart?
wkix32.exe should not itself produce a window if you don't make it to (in that case -i needed)

your simple script just needs to silence the outcome. so, instead of:
WRITEPROFILESTRING ("C:\windows\GSS.INI" ,"LAN" , "User ID" , @USERID)
just use:
$returncode=WRITEPROFILESTRING ("C:\windows\GSS.INI" ,"LAN" , "User ID" , @USERID)

that is explained in faq.
think it was "console displays 0's and 1's or similar, check that out.
and then, once this correction is done, just fire the proggy up with run.
this way, the script will exit.
if you fire it with shell, your script will stay there and reserve some 2-6 megabytes of ram.

so:
run "\\mypath\to\myproggy.exe"
$returncode=WRITEPROFILESTRING ("C:\windows\GSS.INI" ,"LAN" , "User ID" , @USERID)
_________________________
!

download KiXnet

Top
#46292 - 2003-10-03 04:07 PM Re: Shutting an application down..
KnownOversight Offline
Lurker

Registered: 2003-10-03
Posts: 3
Loc: London
Cool, thanks I'll give it a go
[Smile]

Top
#46293 - 2003-10-03 04:15 PM Re: Shutting an application down..
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
There's also a FAQ article explaining the difference between RUN and SHELL, worth reading.
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


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

Who's Online
0 registered and 640 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.052 seconds in which 0.024 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