1.

Solve : print ot file from DOS?

Answer»

Hello

i have one BAT FILE, and i whant to print to file everything what this file do.
For example:
test.bat
Quote

cd\
cd c:
cd:\temp3
ping 127.0.01

and this one i whant to save into the file
Quote
D:\>cd\

D:\>cd c:
C:\

D:\>cd:\temp3
The filename, directory name, or volume label syntax is incorrect.

D:\>ping 127.0.01

Pinging 127.0.0.1 with 32 bytes of data:

Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

Ping statistics for 127.0.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, MAXIMUM = 0ms, Average = 0ms
Quote
D:\>cd\

D:\>cd c:
C:\

D:\>cd:\temp3
The filename, directory name, or volume label syntax is incorrect.

What's the purpose in creating a file containing command errors

Code: [Select]test.bat >>outfile.txt
i have 2 bat files, in first i check my NETWORK connection:
Quote
echo off
ping 10.0.0.1 > c:\CheckPoint\ping.txt
findstr "Reply from" c:\CheckPoint\ping.txt
IF %ERRORLEVEL% == 0 GOTO END
cd\
cd c:
call c:\secu.bat >> test.txt

:END
If not ok with connection it calls another bat file which restart my connection(i NEED two files, i can't make it in one)
And i need to log everything what happens in second file(secu.bat)

i try to call it like this c:\secu.bat >> test.txt, it's make file called test.txt but this file is empty.try using call command

Code: [Select]call c:\path\of\file.bat


Discussion

No Comment Found