Avatar of FSCSexpert
FSCSexpert
 asked on

Delprof utility

Hello
I am trying to run delprof in batch mode to delete all cached profiles on approx 200 remote PCs.
delprof works fine when I run it from a command prompt - finds the remote machine - deletes the profiles succesfully.
problem is when i put the syntax into a batch file - it runs up Delprof but displays error message "the network path was not found" for every PC on the domain -
I can obviously run this from a command prompt on a per machine basis but this will take forever - any suggestions
thanks
Windows 2000

Avatar of undefined
Last Comment
fertigj

8/22/2022 - Mon
fertigj

echo off
rem   This is a simple script that can copy files to a lot of machines at
rem   once.   The script will go through the list of commands that are put
rem   in below and run them on each machine that is listed in the server.txt
rem   file.   If a machine is not on the network, it will be skipped, and the script
rem   will move onto to the next machine until the last machine is reached.
rem   If there is a problem with a machine, a problem.txt file will be generated
rem   and all the problem machine names will be listed within this text file.  Likewise,
rem   all of the machines that were successful, will be listed in a good.txt file.
rem   THIS SCRIPT MUST BE RUN FROM A WINDOWS NT or 2000 box or it will not work.
Rem  Put all of the machines in a text file called Machines.txt

rem task.cmd


@echo off



for /f %%a in (machines.txt) do call :TASK_TO_PERFORM %%a
goto :EOF

:TASK_TO_PERFORM

      rem This line simply tells you which computer is being worked on
        echo Working on computer #%1 now!
      
        Rem This line checks to see if the computer is on the network
        Rem If the computer is not on the network, it will be skipped
      Rem and the script will move onto the next computer on the list.

        if not exist "\\%1\C$\*.*" goto :error
      

        Rem ----------------------------------------------------
        Rem Add your commands here!


        start delprof /q /i /c:\\%1
      
   
        Rem ----------------------------------------------------

       
        Rem This section writes to good.txt if the commands above where completed
        Rem without any problems for a given computer

      echo "---------------------------------------" >> good.txt
        date /t >> good.txt  
        time /t >> good.txt
        echo Computer %1 has been completed! >> good.txt
      echo.
goto :EOF


Rem This section writes an error to a file to log computers missed
:error
    echo "---------------------------------------" >> problems.txt
    date /t >> problems.txt  
    time /t >> problems.txt
    echo Computer #%1 had problems >> problems.txt
goto :EOF
ASKER CERTIFIED SOLUTION
fertigj

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Your help has saved me hundreds of hours of internet surfing.
fblack61