i need help on how to put a temp file for my outputs

December 1, 2012 at 19:44:47
Specs: Windows 7
how can i create a temp file to record the outputs to this shell script that i created @echo off
:options
cls
echo =====================
echo MENU OPTIONS:
echo =====================
echo ipconfig
echo ipconfig all
echo ping
echo tracert
echo =====================
echo q to quit
echo =====================
set /p input="Enter Options Here: "

if "%input%"=="ipconfig" goto:ipconfig
if "%input%"=="ipconfig all" goto:ipconfigall
if "%input%"=="ping" goto:ping
if "%input%"=="tracert" goto:tracert
if "%input%"=="q" goto:exit


echo Please choose from the Options listed above!
pause
goto:options

:ipconfig
ipconfig.exe
pause
goto:options


:ipconfigall
ipconfig.exe /all
pause
goto:options

:ping
ping yahoo.com
pause
goto:options


:tracert
tracert yahoo.com
pause
goto:options


:exit
exit


See More: i need help on how to put a temp file for my outputs

Report •


#1
December 1, 2012 at 20:56:49
ipconfig.exe > T

and so on

==============================
M2 http://golden-triangle.com


Report •

#2
December 1, 2012 at 20:56:50
:: the foll clears the log each time.
@echo off>log
...
ipconfig
ipconfig.exe >> log
pause
goto:options

:ipconfigall
ipconfig.exe /all >> log
pause
goto:options

:ping
ping yahoo.com >> log
pause
goto:options

:tracert
tracert yahoo.com >> log
pause
goto:options


Report •

#3
December 1, 2012 at 23:26:40
nbrane i tried that but its only doing the ipconfig command but not pinging it or tracert

Report •

Related Solutions

#4
December 2, 2012 at 07:12:15
Take the @echo off, and see where it is hanging up, if it is. :) just in case nbrane is not around today, best way to see what is really going on is to watch it in action.

:: mike


Report •

#5
December 2, 2012 at 11:21:17
(Hello Mike, I think you are right to try the echo thing. something "else" is going on here that I don't see).
@Chellgarik: I copy/pasted your batch to both win-xp and win-7 and could not encounter any problem with the output-redirect or anything else. Unless you are referring to not being able to view the output being generated, in which case you will need a simple vbs "tee" to split the output:
'=== begin vbscript Tee.vbs
do while not wscript.stdin.atendofstream
x=wscript.stdin.readline
wscript.stdout.writeline(x)
wscript.stderr.writeline(x)
loop
'=== end vbscript
and used like this:
ping yahoo.com | cscript tee.vbs 2>>log

That was all I could think of to do to improve things (except for adding "/b" to that dad-blamed "exit" that kept closing my command-prompt, and putting a -w 5 on the tracert to speed it up.)


Report •


Ask Question