Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What the heck, it's Friday let's drive some people nuts.
#1
I want to automate some commands in a CMD window.  I need to capture output and input "only from that window" (text only in this case).
I expect this would require a third party program to help me.

My problem:
   I need to repeatedly send commands to Raspberry PI's on my network.  I can use SSH to remotely send commands to each PI.  I can even automate some keystrokes using AUTOHOTKEY.  But all this is repetitive.  Very boring and time consuming.  I am by nature lazy as f*ck.  The torturous part it's not as simple to sending a one line ssh command.  I may want to do more than one thing in that window.  All requiring input and outputs, of various natures.

Why reinvent that wheel.  When I am almost 100% sure someone here already found that wheel and is using it.  Care to share ?

Thanks.
Reply
#2
I use AutoHotKey a LOT in my work to do exactly this.  In my case I use QB64pe to comb through incoming data, then create the logic that needs to be performed, and then QB64pe writes the .AHK script and launches it via the shell command.  It works very well and is reliable when written properly.
Reply
#3
(10-18-2024, 10:41 AM)doppler Wrote: I want to automate some commands in a CMD window.  I need to capture output and input "only from that window" (text only in this case).
I expect this would require a third party program to help me.
Well, in the MSDOS window of Windows 95 and up, you could run a command of dosomething.exe arg1 "argument 2" arg3 >results.lst
so putting that command in a QB64 SHELL command, then read that results.lst file. On Linux you use the same type of command sequence. If I am misunderstanding you, please give more details.

"Well there must be some misunderstanding."
- Phil Collins
While 1
   Fix Bugs
   report all bugs fixed
   receive bug report
end while
Reply
#4
The problem with AutoHotKey.  It's only a keyboard spewer with no feedback.  Need to tweak wait commands for things not keyboard queue-able, especially dealing with drop down windows. So input and output timing can not be controlled.  I automate autohotkey commands to send things.  But I need to be the commander at the keyboard and select the windows.

Using dos piping (ie: < and >) is only usable until you do it.  If I use "ssh" command in a cmd batch, all is well until ssh program executes.  Then the batch execution point suspends until I exit ssh.  To proceed after the batch ssh command line.  So it's good to get me into ssh, but no more automation when it starts.

This was really a PIE-IN-THE-SKY expectation.  Thought might be a magician out there who could work there VooDoo.
Reply
#5
So pipecom can be fitted to do STDIN but I have not looked at it in a long time. With that, you'd be able to grab STDOUT as well, which should effectively make the window interactive. I'd have to find my latest code somewhere. Not sure where it is anymore.
Tread on those who tread on you

Reply




Users browsing this thread: 1 Guest(s)