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,918 of 68,980   
   Dallas to All   
   Re: batch file structure   
   07 Jul 22 11:34:49   
   
   From: dallas@texas.usa   
      
   On 7/7/2022 11:22 AM, Auric__ wrote:   
   > Dallas wrote:   
   >> On 7/6/2022 3:59 PM, Auric__ wrote:   
   >>> Dallas wrote:   
   >>>> On 7/5/2022 11:43 AM, Auric__ wrote:   
   >>>>> The majority of my batch files tend to be one-liners anyway.   
   >>>>   
   >>>> How do you code a batch one-liner ?   
   >>>> I can't remember coding any one-liners.   
   >>> Like this:   
   >>>     dir/a-d/b/s|find /v /i ".mp3">\list.txt   
   >>> or this:   
   >>>     D:\Wintools\Programming\tcc\tcc.exe *.c   
   >>> or this:   
   >>>     for %%x in (*.baf) do AICompile FILE %%~nx.baf %%~nx.err %%~nx.bcs   
   >>> or even just:   
   >>>     del *.bak   
   >>>   
   >>> All of them almost exclusively ran from the GUI, not the command line.   
   >>> I generally use batch files as scripts, not complete programs.   
   >>   
   >> What did you name those batch files?   
   >   
   > find-non-mp3s.bat   
   > compile-tcc.bat   
   > cmp.bat   
   > killbaks.bat (although if I had to type it out, it'd probably be 'kbk.bat')   
   >   
   >> How do you run a batch file from the GUI ?   
   >   
   > Just like anything else in the GUI, double-click it, or select it and press   
   > Enter. The batch is run from the directory it's in, unless you make a .lnk   
   > (or .pif) with a different "Start in" directory.   
   >   
   > - 'find-non-mp3s.bat' was run in the top level of my Music directory   
   > - 'compile-tcc.bat' is run in whatever dir contains C files I need compiled   
   > - 'cmp.bat' is for a game mod I was working on, a long time ago   
   > - a copy of 'killbaks.bat' exists in every directory I have where .bak files   
   >    are regularly created that I don't want to save   
   >   
      
   I just now noticed that none of the one-liners has any arguments.   
   The %1 %2 %3 ... arguments.   
   So, running by double clicking makes more sense to me now.   
      
   I suppose if you did need arguments you could prompt for them as the batch   
   file ran.   
      
   --- 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