home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch.nt      Fun with Windows NT batch files      68,980 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 67,929 of 68,980   
   Zaidy036 to Peter   
   Re: How Do I Capture Screen Text Into a    
   26 Aug 22 15:13:10   
   
   From: Eric@Bloch.com   
      
   On 8/26/2022 1:40 PM, Peter wrote:   
   > How do I “capture” text on the screen into a variable in a batch file?    
   Specifically, this is what I need to do:   
   >   
   > 1.	The batch file will issue a command to check the status of something in   
   the PC.   
   > 2.	The PC will respond with about 6 lines of text on the screen (the 3rd   
   line is blank).   
   > 3.	I need to capture that text.   
   > 4.	The batch file will then check the first three words on the 4th line of   
   text and will then GOTO depending on the first three words.   
   >   
   > I need some help with steps 3 & 4.   
   >   
   > For step 3, how do I capture that text as it is displayed on the screen? I   
   assume it goes into a variable but I don’t know how to get that screen text   
   into a variable.   
   >   
   > For step 4, how do I get the batch file to look at the first three words on   
   line four?   
   >   
   > Thanks!   
      
   Command in #1 should direct output to a file (CMD > F:\test.txt) and   
   then use FINDSTR if text in line 4 is consistent or extract that line   
   and use SET /P _GO=<[line 4].   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca