Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

DOS utility to display 1st line of all files in directory? (Users)

posted by Rugxulo Homepage, Usono, 26.12.2012, 23:05

> Hi again, Rugxulo!
>
> In that BAT file you posted for me, I see that it calls a QBASIC program
> called ONELINE.BAS. Where can I find a copy of that?

It's inline in the .BAT itself, see below. It's basically a temporary "scrap" code file that is written to %TEMP% then executed.


OPEN ENVIRON$("MYFILE") FOR INPUT AS #1
INPUT #1, line$ : PRINT line$
CLOSE
SYSTEM


> >
> > @echo off
> > REM Usage:  for %a in (*.txt) do call oneline.bat %a
> > set B1=%TEMP%.\oneline.bas
> > echo OPEN ENVIRON$("MYFILE") FOR INPUT AS #1 >%B1%
> > echo INPUT #1, line$ : PRINT line$ >>%B1%
> > echo CLOSE >>%B1%
> > echo SYSTEM >>%B1%
> > :begin
> > set MYFILE=%1
> > qbasic /run oneline.bas
> > for %%z in (MYFILE B1) do set %%z=
> >

 

Complete thread:

Back to the forum
Board view  Mix view
22762 Postings in 2122 Threads, 402 registered users (1 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum