Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Yes I have a Machintosh, please don't scream at me. -- Larry Blumette on linux-kernel


devel / alt.msdos.batch / Re: How do I run interactive commands

SubjectAuthor
* How do I run interactive commandsT
`* Re: How do I run interactive commandsJJ
 `* Re: How do I run interactive commandsT
  +* Re: How do I run interactive commandsT
  |`* Re: How do I run interactive commandsJJ
  | `- Re: How do I run interactive commandsT
  `- Re: How do I run interactive commandsKerr-Mudd, John

1
How do I run interactive commands

<tkccvt$3nnls$1@dont-email.me>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=267&group=alt.msdos.batch#267

 copy link   Newsgroups: alt.msdos.batch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: T...@invalid.invalid (T)
Newsgroups: alt.msdos.batch
Subject: How do I run interactive commands
Date: Mon, 7 Nov 2022 17:56:13 -0800
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <tkccvt$3nnls$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 8 Nov 2022 01:56:13 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="b40f546d57d01b38500984add833d474";
logging-data="3923644"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX191v0aMB+aacJnglbiCqaRUvRZ5u3f/5JI="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.0
Cancel-Lock: sha1:7/zY8qRszRnpgBYjVCeoJA0ZQnQ=
Content-Language: en-US
 by: T - Tue, 8 Nov 2022 01:56 UTC

Hi All,

I am scratching my head trying to figure out how to
gather information from a RAID controller.

I need to issue the following commands to the controller's
configuration utility:

hptraidconf
query array
exit

In Linux bash programming, there is a way, but I
know of no way to do it with Windows.

Many thanks,
-T

Re: How do I run interactive commands

<170uh5n9b4hei$.1i2ic28l403lo.dlg@40tude.net>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=268&group=alt.msdos.batch#268

 copy link   Newsgroups: alt.msdos.batch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: jj4pub...@outlook.com (JJ)
Newsgroups: alt.msdos.batch
Subject: Re: How do I run interactive commands
Date: Tue, 8 Nov 2022 19:34:43 +0700
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <170uh5n9b4hei$.1i2ic28l403lo.dlg@40tude.net>
References: <tkccvt$3nnls$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: reader01.eternal-september.org; posting-host="718c66e6acb2f491c6399cca9001eee3";
logging-data="4110995"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+K+RZV5goa2crjJT2u8Ym0a+eagmEo0yM="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:mGyWbcmM0HeGGXBtTyVZeONzG+k=
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
 by: JJ - Tue, 8 Nov 2022 12:34 UTC

On Mon, 7 Nov 2022 17:56:13 -0800, T wrote:
> Hi All,
>
> I am scratching my head trying to figure out how to
> gather information from a RAID controller.
>
> I need to issue the following commands to the controller's
> configuration utility:
>
> hptraidconf
> query array
> exit
>
> In Linux bash programming, there is a way, but I
> know of no way to do it with Windows.
>
> Many thanks,
> -T

Try doing it like below.

@echo off
( echo hptraidconf
echo query array
echo exit
) | "c:\program files\raid mgmt\raid-configurator.exe"

Re: How do I run interactive commands

<tken1m$t36$1@dont-email.me>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=269&group=alt.msdos.batch#269

 copy link   Newsgroups: alt.msdos.batch
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: T...@invalid.invalid (T)
Newsgroups: alt.msdos.batch
Subject: Re: How do I run interactive commands
Date: Tue, 8 Nov 2022 15:00:05 -0800
Organization: A noiseless patient Spider
Lines: 76
Message-ID: <tken1m$t36$1@dont-email.me>
References: <tkccvt$3nnls$1@dont-email.me>
<170uh5n9b4hei$.1i2ic28l403lo.dlg@40tude.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 8 Nov 2022 23:00:06 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="e8eb117d2d97e006b8cb1015d1a40b30";
logging-data="29798"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1892Itr5cd0MgIqQ8AJEddxqW8IihhJ9Gc="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.0
Cancel-Lock: sha1:/HT0NE2DmPnBEvUMVXfRof1hslE=
In-Reply-To: <170uh5n9b4hei$.1i2ic28l403lo.dlg@40tude.net>
Content-Language: en-US
 by: T - Tue, 8 Nov 2022 23:00 UTC

On 11/8/22 04:34, JJ wrote:
> On Mon, 7 Nov 2022 17:56:13 -0800, T wrote:
>> Hi All,
>>
>> I am scratching my head trying to figure out how to
>> gather information from a RAID controller.
>>
>> I need to issue the following commands to the controller's
>> configuration utility:
>>
>> hptraidconf
>> query array
>> exit
>>
>> In Linux bash programming, there is a way, but I
>> know of no way to do it with Windows.
>>
>> Many thanks,
>> -T
>
> Try doing it like below.
>
> @echo off
> (
> echo hptraidconf
> echo query array
> echo exit
> ) | "c:\program files\raid mgmt\raid-configurator.exe"

Thank you JJ!

I wrote this up as a Keeper:

How to run interactive programs from batch

echo inside (), then pipe to your command

Example

<DiskPart.ListVol.bat>

@echo off
( echo List volume
echo exit
) | C:\Windows\System32\diskpart.exe

</DiskPart.ListVol.bat>

K:\Windows\NtUtil>DiskPart.ListVol.bat

Microsoft DiskPart version 6.1.7601
Copyright (C) 1999-2008 Microsoft Corporation.
On computer: KVM-W7

DISKPART>
Volume ### Ltr Label Fs Type Size Status Info
---------- --- ----------- ----- ---------- ------- ---------
--------
Volume 0 D CD-ROM 0 B No Media
Volume 1 E virtio-win- CDFS CD-ROM 301 MB Healthy
Volume 2 System Rese NTFS Partition 100 MB Healthy
System
Volume 3 C DRIVE_C NTFS Partition 39 GB Healthy Boot
Volume 4 H BACKUP NTFS Partition 38 MB Healthy
Volume 5 M KVM-W7-Back NTFS Partition 2014 MB Healthy

DISKPART>
Leaving DiskPart...

Re: How do I run interactive commands

<tkeomg$14lo$4@dont-email.me>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=270&group=alt.msdos.batch#270

 copy link   Newsgroups: alt.msdos.batch
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: T...@invalid.invalid (T)
Newsgroups: alt.msdos.batch
Subject: Re: How do I run interactive commands
Date: Tue, 8 Nov 2022 15:28:16 -0800
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <tkeomg$14lo$4@dont-email.me>
References: <tkccvt$3nnls$1@dont-email.me>
<170uh5n9b4hei$.1i2ic28l403lo.dlg@40tude.net> <tken1m$t36$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 8 Nov 2022 23:28:17 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="e8eb117d2d97e006b8cb1015d1a40b30";
logging-data="37560"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19uCpZMyjosPEUulXfQPDlLb0JDCLie7w4="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.0
Cancel-Lock: sha1:HwDurYSX+w9zmS6/dPMwvp02eKY=
In-Reply-To: <tken1m$t36$1@dont-email.me>
Content-Language: en-US
 by: T - Tue, 8 Nov 2022 23:28 UTC

Unfortunately 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
------------------------------------------------------------------------------

Re: How do I run interactive commands

<1t64eswa1h3ke.13ix6j6r0skn0.dlg@40tude.net>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=271&group=alt.msdos.batch#271

 copy link   Newsgroups: alt.msdos.batch
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: jj4pub...@outlook.com (JJ)
Newsgroups: alt.msdos.batch
Subject: Re: How do I run interactive commands
Date: Wed, 9 Nov 2022 07:53:33 +0700
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <1t64eswa1h3ke.13ix6j6r0skn0.dlg@40tude.net>
References: <tkccvt$3nnls$1@dont-email.me> <170uh5n9b4hei$.1i2ic28l403lo.dlg@40tude.net> <tken1m$t36$1@dont-email.me> <tkeomg$14lo$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: reader01.eternal-september.org; posting-host="165ffc3feec5b80663f6b4ca364fae82";
logging-data="50026"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19T6idwaY53MpeRtTJY8kd5m2YE06h1a8U="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:hjUD4q2SMx8CMSej4Yb7iyQdAsU=
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
 by: JJ - Wed, 9 Nov 2022 00:53 UTC

On Tue, 8 Nov 2022 15:28:16 -0800, T wrote:
> Unfortunately 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.

Re: How do I run interactive commands

<tkfp5b$6928$1@dont-email.me>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=272&group=alt.msdos.batch#272

 copy link   Newsgroups: alt.msdos.batch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: T...@invalid.invalid (T)
Newsgroups: alt.msdos.batch
Subject: Re: How do I run interactive commands
Date: Wed, 9 Nov 2022 00:42:19 -0800
Organization: A noiseless patient Spider
Lines: 71
Message-ID: <tkfp5b$6928$1@dont-email.me>
References: <tkccvt$3nnls$1@dont-email.me>
<170uh5n9b4hei$.1i2ic28l403lo.dlg@40tude.net> <tken1m$t36$1@dont-email.me>
<tkeomg$14lo$4@dont-email.me> <1t64eswa1h3ke.13ix6j6r0skn0.dlg@40tude.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 9 Nov 2022 08:42:19 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="e8eb117d2d97e006b8cb1015d1a40b30";
logging-data="205896"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18IKG19CgXB67PazFc1YALDq6QBtF1mB0w="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.0
Cancel-Lock: sha1:9HDXkNBfRjh7T2Bsan3vrULC97Y=
Content-Language: en-US
In-Reply-To: <1t64eswa1h3ke.13ix6j6r0skn0.dlg@40tude.net>
 by: T - Wed, 9 Nov 2022 08:42 UTC

On 11/8/22 16:53, JJ wrote:
> On Tue, 8 Nov 2022 15:28:16 -0800, T wrote:
>> Unfortunately 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.

Bugger!

@echo off

(
timeout 10 > nul
echo query array
timeout 10 > nul
echo exit

) | "C:\Program Files (x86)\HighPoint Technologies, Inc\HighPoint RAID
Management\Service\hptraidconf.exe"

The process tried to write to a nonexistent pipe.
The process tried to write to a nonexistent pipe.

Re: How do I run interactive commands

<20221109104257.329cbd7ddec7a8c66c108ae8@127.0.0.1>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=273&group=alt.msdos.batch#273

 copy link   Newsgroups: alt.msdos.batch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: adm...@127.0.0.1 (Kerr-Mudd, John)
Newsgroups: alt.msdos.batch
Subject: Re: How do I run interactive commands
Date: Wed, 9 Nov 2022 10:42:57 +0000
Organization: Dis
Lines: 33
Message-ID: <20221109104257.329cbd7ddec7a8c66c108ae8@127.0.0.1>
References: <tkccvt$3nnls$1@dont-email.me>
<170uh5n9b4hei$.1i2ic28l403lo.dlg@40tude.net>
<tken1m$t36$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: reader01.eternal-september.org; posting-host="9dc5ea712e77aa0c355efc79dcb8dde9";
logging-data="227452"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19brjlBfw2OGUBLY2cVONC2v3fV7+nPTk0="
Cancel-Lock: sha1:zQ1V+n3hO/3GOleqUYcw+fZx8IY=
X-Newsreader: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
;X-no-Archive: Maybe
GNU: Terry Pratchett
 by: Kerr-Mudd, John - Wed, 9 Nov 2022 10:42 UTC

On Tue, 8 Nov 2022 15:00:05 -0800
T <T@invalid.invalid> wrote:

> On 11/8/22 04:34, JJ wrote:
[piped commands]]
>
> Thank you JJ!
>
> I wrote this up as a Keeper:
>
>
> How to run interactive programs from batch
>
> echo inside (), then pipe to your command
>
>
> Example
>
> <DiskPart.ListVol.bat>
>
> @echo off
> (
> echo List volume
> echo exit
> ) | C:\Windows\System32\diskpart.exe
>
> </DiskPart.ListVol.bat>
>

Thanks.

--
Bah, and indeed Humbug.

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor