Page 1 of 1

Run command prompt script in Windows and keep window visible

Posted: Tue Nov 26, 2019 2:24 pm
by japino
Hi, I'm trying to run a command in a command prompt window in Windows and keep the command prompt window open while the command is running and when the command is finished.

To test this, I'm using this simple script:

Code: Select all

on mouseUp
   set the hideconsolewindows to false
   put shell("dir c:\") into myOutput
end mouseUp
The command works fine and I can continue with the result, but what happens is this: a command prompt window is opened and then closed very quickly. What I would like is to see is for the command prompt window to remain open after the command has run. This is because I'm going to use a time-consuming command and I want to follow what's going on. I guess this can be done but I didn't find the answer on the forum (if the answer is there I need to work on my searching capabilities). Thanks in advance.

Re: Run command prompt script in Windows and keep window visible

Posted: Wed Nov 27, 2019 1:51 pm
by japino
I got this to work by having my script create a .bat file which ends with a PAUSE command and having LiveCode launch that .bat file...

Re: Run command prompt script in Windows and keep window visible

Posted: Wed Nov 27, 2019 4:02 pm
by [-hh]
Clever idea.