guillaume zac
guillaume zac

Reputation: 103

write command in interactive prompt (powershell or bat)

I work in program with interactive prompt call XDIAL I want write *select * from pcastd* in this prompt like this

 D:\Aither\Exe\xdial.exe  
 start-sleep-seconds 1
/C "select * from pcastd"

xdial interactive prompt

there is not "select * from pcastd" writed ...

how to do this ?

Upvotes: 0

Views: 241

Answers (1)

mklement0
mklement0

Reputation: 438198

As an alternative to interactive input, command-line utilities typically accept input via the pipeline, which sends an input command's output to the target utility's stdin (standard input):

Therefore, you can echo the string of interest and pipe it to xdial.exe:

# From PowerShell
'select * from pcastd' | xdial.exe
REM # From cmd.exe
REM # Note that there's no space before the "|" by design,
REM # because a space would become part of `echo`'s output.
echo select * from pcastd| xdial.exe

Upvotes: 1

Related Questions