Copy all contenet of Dos screen into some txt

Lowel To go 98 tungsten light kit - cons...
February 4, 2010 at 03:55:08
Specs: Windows XP, 3.0
This my rnd.bat

@echo off

echo. my name is Kha
echo Creating Build for files in Module %temp% to the Server
echo. Call some php file contenet
echo. Call some java file contenet

here their would be some command which print all data in txt file
pause

when i execute it should show
.................................................
my name is Kha
Creating Build for files in Module %temp% to the Server

php code
fsdfs
fs
fsdf
sf
sf
sd
end php code

java code
fsdfs
fs
fsdf
sf
sf
sd
end java code
....................................................

now this at last it should copy this all executed content into some txt file


Can any one help me please


See More: Copy all contenet of Dos screen into some txt

Report •


#1
February 4, 2010 at 04:16:13
You could run the script from the command line like so:

> Somenewfil.txt rnd.bat

As I mentioned in this thread there is no way for a batch file
to access the console buffer.

What you could do if you don't want to run from the command
line is redirect each command to a text file.

@echo off

>"Somefile.txt" echo my name is Kha
>>"Somefile.txt" echo Creating Build for files in Module %temp% to the Server
>>"Somefile.txt" echo. Call some php file contenet
>>"Somefile.txt" echo. Call some java file contenet 

Now finally if you want to have the text both on screen and in file.

@echo off

>"Somefile.txt" echo my name is Kha
echo my name is Kha
>>"Somefile.txt" echo Creating Build for files in Module %temp% to the Server
echo Creating Build for files in Module %temp% to the Server
for /f "tokens=1* delims=]" %%a in (' echo. Call some php file contenet^| find /n /v ""') do (
    echo.%%b
    >>"Somefile.txt" echo.%%b
)
for /f "tokens=1* delims=]" %%a in (' Call some java file contenet ') do (
    echo.%%b
    >>"Somefile.txt" echo.%%b
)

I am assuming that "Call some java file contenet" means you are
actually running something with text output.

My boring little personal page(in progress)


Report •

#2
February 4, 2010 at 05:01:08
Hi Judago,

Thank you very much. Anyway this will run my train smoothly . :)

Regards,
Ganesh


Report •
Related Solutions


Ask Question