Windows Dos window doesn't work?

Alex Tweedly alex at tweedly.net
Wed Dec 15 20:44:23 EST 2004


At 18:07 15/12/2004 -0700, Dar Scott wrote:


>On Dec 15, 2004, at 3:18 PM, Glen Bojsza wrote:
>
>>on mouseup
>>open process "cmd" for read         # it opens a cmd window but fails
>>to return a prompt
>>end mouseup
>>
>>Sorry for pushing this but I'm stuck on the road without another
>>machine to test with.
>
>Glen, I'll look at this now.

No need - it was indeed the fact that it was being piped to the stack.

I gave Glen an example of using
     open process "cmd" for update
that both wrote his commands and read the result; so I don't think there's 
any need for you took at that problem.

But I'd like to hear any more you remember about problems with open process 
on Windows.


>In the mean time, I recommend using shell() if you possibly can.
>
>If you don't need a back and forth dialog, try piping a file into cmd 
>using shell().  You can set that file from your script and delete it 
>afterward.  You can put it into the appropriate specialFolderPath().
>If it is sensitive, you might have to wipe the file or just use this 
>approach until you can make open process work for you.  You may want to 
>set hideConsoleWindows.

So would you do something like
   put "d:" & cr & "cd \My folder\my directory" & cr & "dir *.jpg" & cr 
into URL "my.bat"
   put shell("cmd < my.bat")
   delete file "my.bat"

(assuming you get all these in the correct folders :-)

Thanks
-- Alex.


More information about the use-livecode mailing list