Batch file with a flag -- need assistance

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: Klaus, FourthWorld, heatherlaine, kevinmiller

shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 334
Joined: Fri Jun 01, 2012 11:11 pm
Location: USA

Re: Batch file with a flag -- need assistance

Post by shawnblc » Wed Apr 17, 2019 6:04 am

SparkOut wrote:
Tue Apr 16, 2019 10:07 am
Ok.

Try

Code: Select all

put "cmd /k" && tFile into tFile
get shell (tFile)
put it
Or add "cmd /k" as the last line of your batch file
@SparkOut I'll give it shot and update here.

FourthWorld wrote:
Tue Apr 16, 2019 2:36 pm
Good tip, SparkOut.

What is the advantage to the user in displaying the output in the console window?
@FourthWorld I'd say there is no real advantage. I'm not sure how to display the output and answer the bat file questions and keep it all contained in LC. :)

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6720
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Batch file with a flag -- need assistance

Post by FourthWorld » Wed Apr 17, 2019 6:09 am

What would normally go to the console should be delivered to you as the return value from the shell function.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 334
Joined: Fri Jun 01, 2012 11:11 pm
Location: USA

Re: Batch file with a flag -- need assistance

Post by shawnblc » Wed Apr 17, 2019 10:08 am

Still no luck.

Could it be that the file is in use (or memory) and I'm not getting that error.

bogs
Posts: 3562
Joined: Sat Feb 25, 2017 10:45 pm

Re: Batch file with a flag -- need assistance

Post by bogs » Wed Apr 17, 2019 4:13 pm

I'm not sure why you wouldn't receive any input, I set up this simple test of my answer to your post with a batch file I wrote, if you don't use a flag, you get the standard "hello", and if you do use a flag you get an echo of the flag.

This is on a Win7 machine -
Win7Tester [Running] - Oracle VM VirtualBox_001.png
No flag...
Win7Tester [Running] - Oracle VM VirtualBox_002.png
With flag...
Open your message box, and run your batch file the same way, with the flag your shooting for, then put a screen shot of it if your still not seeing the result you expect so we can see what is happening.

*Edit - I had forgotten about what Thunder pointed out -
in your tron.bat file :
:: Requirements: Run from the current users desktop. Run as Administrator.
I'm not sure that Win runs it as an admin just because your running the exe calling it as an admin. It has been too long since I used Windows for me to remember either, but I'm pretty sure you'd have to call the bat with admin credentials, not just from the sign in.
Image

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”