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,583 of 68,980   
   JJ to vjp2.at@at.BioStrategist.dot.dot.co   
   Re: How to pipe an init file   
   18 Jun 20 18:54:47   
   
   From: jj4public@vfemail.net   
      
   On Wed, 17 Jun 2020 16:01:06 +0000 (UTC),   
   vjp2.at@at.BioStrategist.dot.dot.com wrote:   
   > I have a program which takes multpiple commands like a regular command line   
   > processor.   
   >   
   > There are several commands I want to run when I start, then return to the   
   > internal command line processor.   
   >   
   > if I do   
   > talktome < x.talk   
   > It assumes I'm done and exits.   
      
   You could do it like this.   
      
     @echo off   
     setlocal   
     for /f "delims=" %%A in ('more') do (   
       %%A   
     )   
     rem do the main task of batch file...   
      
   But that batch file should be used with redirected input. e.g.   
      
     mybatch.bat < commands.txt   
      
   Or...   
      
     myprog.exe | mybatch.bat   
      
   If it's not used with redirected input, it will wait for input from the   
   keyboard. If input is not needed, the NUL device must be used as redirected   
   input, to prevent the batch file from asking for input from the keyboard.   
   e.g.   
      
     mybatch.bat < nul   
      
   Unfortunately, I have not yet figure out how to detect whether the standard   
   input is a file/device or the keyboard.   
      
   --- 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