Post by TUnfortunately my command won't take pipes too well, but
they have a way off accepting the command on the command
line.
You prefixing you command with
"hptraidconf -u RAID -p hpt"
For example: hptraidconf -u RAID -p hpt query devices
C:\NtUtil>"C:\Program Files (x86)\HighPoint Technologies, Inc\HighPoint
RAID Management\Service\hptraidconf.exe" -u RAID -p hpt query devices
ID Capacity MaxFree Flag Status ModelNumber
------------------------------------------------------------------------------
1/E1/1 1000.20 0 SINGLE LEGACY Samsung SSD 980 1TB
1/E1/2 1000.20 0 SINGLE LEGACY Samsung SSD 980 1TB
------------------------------------------------------------------------------
Some CLI tool clears the input buffer at program startup. In this case, try
doing it like below.
@echo off
(
timeout 2 > nul
echo query array
echo exit
) | hptraidconf
The timeout duration should be long enough to postpone the input injection
so that, it will be injected after the tool actually starts asking for an
input.
If the CLI tool clears the input buffer each time it ask for an input, then
there need to be a delay before each command. e.g.
@echo off
(
timeout 2 > nul
echo query array
timeout 2 > nul
echo exit
) | hptraidconf
In above case, the second timeout duration should include the time need for
the `query array` command to complete. i.e. if that command took 2 seconds
to complete, then the second timeout duration should be at least 3 seconds.
If nothing with piping works, it means that the CLI tool ask for the input
directly from the keyboard rather than the standard input. In this case, a
tool such as Windows Script Host (VBScript/JScript), or Autohotkey should be
used to generate keyboard key presses.