Page 1 of 1 1
Topic Options
#155780 - 2006-01-22 02:25 PM Shell and wait
Golan111 Offline
Fresh Scripter

Registered: 2006-01-04
Posts: 8
Helllo all,
I need to run an exe file for each file in a specific directory (the file name is an input parameter).
I'm using a while loop and inside a shell command that calls the specific exe.
My question - I need that the exe will handle a file only after it has finished the previous file (like start/wait in dos). How can I do this?

Thanks

Top
#155781 - 2006-01-22 02:37 PM Re: Shell and wait
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Try using SHELL like this:

SHELL "%COMSPEC% /C " + $exefile

Top
#155782 - 2006-01-22 02:39 PM Re: Shell and wait
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
or include start /wait on the shell line.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#155783 - 2006-01-22 08:10 PM Re: Shell and wait
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
so...
again.
use:
shell "my.exe"

or, in some cases, you may need to use start wait, thus:
shell "%comspec% /c start /wait my.exe"

you never need to use any comspec otherwise, unless you are using a console application.
_________________________
!

download KiXnet

Top
#155784 - 2006-01-23 07:42 AM Re: Shell and wait
Golan111 Offline
Fresh Scripter

Registered: 2006-01-04
Posts: 8
Thank you all. This solves the problem.
Top
#155785 - 2006-01-23 08:23 AM Re: Shell and wait
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
which this?
_________________________
!

download KiXnet

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 641 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.056 seconds in which 0.027 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