On 11/7/22 17:50, ToddAndMargo via perl6-users wrote:
Hi All,

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

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

     hptraidconf
     query array
     exit

I typically will creating a temporary batch/cmd file
and then executing it.

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

Many thanks,
-T

Hi All,

JJ over on the batch newgroup help me out.
Basically, you create a batch file that echos
the commands you want and then run the batch
file.

I wrote this up in my Batch keepers:

Thank you JJ!

I wrote this up as a Keeper:


How to run interactive programs from batch

echo inside (), then pipe to your command
Note: this presumes that your command will take a pipe



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



Reply via email to