Run command prompt script in Windows and keep window visible

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
japino
Posts: 78
Joined: Sun Oct 14, 2012 10:56 am

Run command prompt script in Windows and keep window visible

Post by japino » Tue Nov 26, 2019 2:24 pm

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.

japino
Posts: 78
Joined: Sun Oct 14, 2012 10:56 am

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

Post by japino » Wed Nov 27, 2019 1:51 pm

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...

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

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

Post by [-hh] » Wed Nov 27, 2019 4:02 pm

Clever idea.
shiftLock happens

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”