PDA

View Full Version : Piped FOR Loop -- Need Help ASAP



Cyphonik
Jan 16th, 2007, 06:48 PM
I know this is basic however, the FOR loop is closely related to the javascript FOR loop.

When I run the script, the FOR loop before the pipe executes flawlessly. When the dir/b > dir.txt is piped to the second FOR loop I get the error, "The system cannot find the file dir.txt."


net stop "symantec antivirus"

ECHO Mapping Drive Cleaner Folder
if exist m: net use m: /delete /y
if not exist m: (net use m: "\\auab-file-n\fileroot\ECES\379 ECES\CEE (Escort)\Additional Duties\CSA\drive cleaner")

m:
cd\

ECHO Double FOR Loop...Assigns VAR to Computer Names and Documents and Settings Folders
for /f %%i in (computers.txt) do dir /b "\\%%i\c$\Documents and Settings" > dir.txt | for /f %%j in (dir.txt) do RD /S/Q "\\%%i\c$\Documents and settings\%%j\Local Settings\Temporary Internet Files"

Shaffer
Jan 16th, 2007, 06:55 PM
Please just submit your script.

Cyphonik
Jan 16th, 2007, 08:16 PM
net stop "symantec antivirus"

ECHO Mapping Drive Cleaner Folder
if exist m: net use m: /delete /y
if not exist m: (net use m: "\\auab-file-n\fileroot\ECES\379 ECES\CEE (Escort)\Additional Duties\CSA\drive cleaner")

m:
cd\

ECHO Double FOR Loop...Assigns VAR to Computer Names and Documents and Settings Folders
for /f %%i in (computers.txt) do dir /b "\\%%i\c$\Documents and Settings" > dir.txt | for /f %%j in (dir.txt) do RD /S/Q "\\%%i\c$\Documents and settings\%%j\Local Settings\Temporary Internet Files"

Cyphonik
Jan 16th, 2007, 08:17 PM
that is the complete Script.