|
Answer» Here's the sit: I've tried two different tactics on this problem. They are:
REM FOR %%F IN (*.) DO (NET USE Z: \\%%F\C$\WINDOWS\TASKS REM DEL Z:\AT*.JOB REM NET USE Z: /DELETE)
and
REM FOR %%F IN (*.) DO (NET USE Z: \\%%F\C$\WINDOWS\TASKS REM DEL Z:\AT*.JOB REM NET USE Z: /DELETE)
The batch file will be run from C:\BATCH\JOBCLEAN\JOBCLEAN.BAT with C:\BATCH\JOBCLEAN\ containing one file for each computer name on the LAN. I've got a simpler batch file that runs well using the same setup. It is:
for %%f in (*.) do delprof /c:\\%%f /d:30 /q /i (where delprof is an external executable stored in the directory with the batch file.)
Here's the question. How can I get a for loop to run multiple commands for the same %%F variable before GOING on to the next one? I really don't want to learn VB Script right now as I'm learning SQL and I don't want to get confused. My computer is running MS Win XP SP3, 2Gb RAM on an TCP/IP network. This will be running against ROUGHLY 400 machines which I have administrator access on.If you want it to wait until the COMMAND is finished then you can put each command into a seperate batch file and use this command:
Code: [Select]Start "batch.bat" /WAIT %%F This would pause the calling batch file until Batch.bat is completed.
Batch1: Code: [Select]@echo off NET USE Z: \\%1\C$\WINDOWS\TASKS
Hope this helps ,NICK(macdad-)
|