Page 1 of 1 1
Topic Options
#176220 - 2007-05-11 07:46 PM Very simple question: keeping prompt open after script
stupid Offline
Fresh Scripter

Registered: 2006-02-17
Posts: 18
I am working with a script at work here, and it closes the prompt each time I run it. I am tired of re-opening the comand prompt and navigating to my script each runthrough.

If I remember correctly, there is a command I can include to keep the window open, but I dont remember it. Thank you.

Top
#176221 - 2007-05-11 08:39 PM Re: Very simple question: keeping prompt open after script [Re: stupid]
eriqjaffe Offline
Hey THIS is FUN

Registered: 2004-06-24
Posts: 214
Loc: Arlington Heights, IL USA
 Code:
? "Press any key..."
Get $

Add that to the end of your script, that will keep the console open until the user presses a key.

You can also use ConText - once you set it up, the command window automatically stays open so you don't have to add any extraneous commands to your script.


Edited by eriqjaffe (2007-05-11 08:41 PM)

Top
#176222 - 2007-05-11 08:52 PM Re: Very simple question: keeping prompt open after script [Re: eriqjaffe]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
You can also launch it with a shortcut to %comspec% that uses /k instead of /c. For my script testing, I have a shortcut as follows:
%SystemRoot%\system32\cmd.exe /k C:\KiX\4.53\kix32.exe
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#176223 - 2007-05-11 09:37 PM Re: Very simple question: keeping prompt open after script [Re: Les]
stupid Offline
Fresh Scripter

Registered: 2006-02-17
Posts: 18
how do you do that?

(the "Press any key" didnt work)

Top
#176224 - 2007-05-11 09:43 PM Re: Very simple question: keeping prompt open after script [Re: stupid]
eriqjaffe Offline
Hey THIS is FUN

Registered: 2004-06-24
Posts: 214
Loc: Arlington Heights, IL USA
Well, do you EXIT or QUIT the script? Because you have to put the code I posted before that, otherwise it will never get to my code.

Sorry, I should have specified that. \:\)

Top
#176225 - 2007-05-11 09:48 PM Re: Very simple question: keeping prompt open after script [Re: stupid]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Simple

Right-click -> New Shortcut -> type the line that suits your folder name, i.e.
%SystemRoot%\system32\cmd.exe /k C:\KiX\4.53\kix32.exe

Name it whatever you want, and you have a shortcut. Drag and drop your script on the shortcut and it runs. When it is finished, the DOS box will stay on the screen.

BTW, the "press the any key" thing would only work if the script makes it to the end. If it bombs out early, it is of no use.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#176226 - 2007-05-11 09:58 PM Re: Very simple question: keeping prompt open after script [Re: Les]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
See also, my FAQ
> Catch that error message that flashes for a second
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#176227 - 2007-05-11 10:26 PM Re: Very simple question: keeping prompt open after script [Re: Les]
eriqjaffe Offline
Hey THIS is FUN

Registered: 2004-06-24
Posts: 214
Loc: Arlington Heights, IL USA
 Originally Posted By: Les
BTW, the "press the any key" thing would only work if the script makes it to the end. If it bombs out early, it is of no use.

Very true. ConText keeps the console open even if the script goes haywire, so it's my preferred method - especially since I can run a script just by hitting F11 (and in debug mode by hitting F12). I even have F-keys that bring up the KiXtart CHM and a UDF CHM file that I made a while back.

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

Generated in 0.061 seconds in which 0.027 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org