Page 1 of 1 1
Topic Options
#8482 - 2001-05-04 05:49 PM Shell runs Asynchronously
Anonymous
Unregistered


I'm having trouble with the "Shell" statement. It seems to run the other program OK, but it just starts the program and returns to KixTart immediately.

How do I get KixTart to wait for the Shell to finish before it resumes?

Top
#8483 - 2001-05-04 08:48 PM Re: Shell runs Asynchronously
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Hi Dave, welcome.

Here's an example using the command shell (%comspec%) and the dir command...

shell '%comspec% /c dir >dir.out 2>nul'

The /c tells the command interpreter to wait for completion...

Shawn.

Top
#8484 - 2001-05-04 08:59 PM Re: Shell runs Asynchronously
Anonymous
Unregistered


Thanks for the quick reply.
I do have the /c in there, but it's still not waiting for me.
Here's the line from my script:
shell "%comspec% /c " + Chr(34) + $DriveM + "\2ksetup.exe" + Chr(34)

I know the "+ Chr(34)"'s aren't reallly necessary, they're there for consistency's sake. We've got other executables with spaces in the name.
Maybe the whole thing should be enclosed in single quotes? But it DOES run the .exe, so I would think comspec is OK, its just not waiting.

Top
#8485 - 2001-05-05 04:13 AM Re: Shell runs Asynchronously
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
You are right about the single quotes:

SHELL ' %comspec% /c "$DriveM\2ksetup.exe" '

would also work. The \ tells KiX that your var is $DriveM.

What is 2ksetup.exe? When you run it from a command prompt does it open another (graphic?) window and return you to the C:\> in the command prompt window immediately?

cj

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 1782 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.122 seconds in which 0.097 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