I am trying to write a batch file that writes batch files, once you see the code you might see why i need a batch file to do this, the problem is that i want the batch files that i create to redirect their output to a text file, but i can't get the first batch file to redirect the redirect if that makes sense.
here is the batch file i have right now:
@ echo off
@set /p name=Enter computer name:
@set /p low=Enter lowest computer number:
@set /p high=Enter highest computer number:
@set /p room=Enter room name or number:
reM resetgenerator.bat namesch start end
REM set /a result=%low%+1
REM if %1 == "" GOTO ERROR
set results=%low%
mkdir %room%
cd /%room%
goto check
:check
IF %results% LEQ 9 goto make
IF %results% GTR 9 goto shake
:make
set result=0%results%
echo tasklist /s \\%name%%result% /fo LIST /fi "USERNAME ne NT AUTHORITY\SYSTEM" /fi "USERNAME ne NT AUTHORITY\LOCAL SERVICE" /fi "USERNAME ne NT AUTHORITY\NETWORK SERVICE" /fi "USERNAME ne N/A" /v >> %name%%result%.bat
GOTO continue
:shake
echo tasklist /s \\%name%%results% /fo LIST /fi "USERNAME ne NT AUTHORITY\SYSTEM" /fi "USERNAME ne NT AUTHORITY\LOCAL SERVICE" /fi "USERNAME ne NT AUTHORITY\NETWORK SERVICE" /fi "USERNAME ne N/A" /v >> %name%%results%.bat
goto continue
:continue
set /a results=%results%+1
if %results% GTR %high% GOTO end
goto check
:end
exit
and this is what i want it to make:
tasklist /s \\nccaihg01 /fo LIST /fi "USERNAME ne NT AUTHORITY\SYSTEM" /fi "USERNAME ne NT AUTHORITY\LOCAL SERVICE" /fi "USERNAME ne NT AUTHORITY\NETWORK SERVICE" /fi "USERNAME ne N/A" /v > "c:\documents and settings\administrator\desktop\resets\tasks\list.txt"
any help is appreciated