Get Shell Silently

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
5imon
Posts: 19
Joined: Fri Nov 22, 2019 8:09 pm

Get Shell Silently

Post by 5imon » Tue Dec 08, 2020 3:57 am

I'm currently trying to perform a get shell() and I'm having random successes in cases where it should just work.

Here's an example where it just works:

Code: Select all

get shell ("dir")
answer it
Works a treat.

The following more complex example also works without a hitch:

Code: Select all

get shell("cd C:/Users/5imon/AppData/Local/HaptUX/ExManCmdWin/ & dir")
answer it
But this won't work:

Code: Select all

get shell("C:/Users/5imon/AppData/Local/HaptUX/ExManCmdWin/ExManCmd /list all" )
... throws and error that it "is not recognized as an internal or external command".

However, with a little jiggery it does:

Code: Select all

get shell("cd C:/Users/5imon/AppData/Local/HaptUX/ExManCmdWin/ & ExManCmd /list " & quote & "all" & quote)
answer it
I don't mind the jiggery too much, but what I'd like to avoid is having the Windows 10 command prompt appearing on screen with a flashing prompt for the entire duration of time it takes for the shell to complete (~1-2 seconds).

Is there some way to run shell in silent mode? Maybe this is a bug in 9.6.2 rc 1? Could it be a new security feature in the latest Windows 10 update that dictates the user see any commands being run in the prompt that they did not personally type in?

Anyone?

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

Re: Get Shell Silently

Post by FourthWorld » Tue Dec 08, 2020 7:52 am

hideconsolewindows is what you're looking for:

https://livecode.com/resources/api/#liv ... olewindows
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

5imon
Posts: 19
Joined: Fri Nov 22, 2019 8:09 pm

Re: Get Shell Silently

Post by 5imon » Tue Dec 08, 2020 3:25 pm

That worked perfectly, thanks Richard.

Post Reply

Return to “Windows”