need a bat file to run with a hidden cmd or minimized cmd window

I have the following code that I need to run every five minutes to purge directories
The code works but it shows a command window until it finishes. can the window be minimized or hidden? if can  you show me in code please? I have a scheduled task set to fire the bat
@echo off
cd "c:\documents and settings\"
rem Enter into top level folder, process it and go back to original folder
pushd x
call :processFolder
popd
goto :EOF

:processFolder

rem For each folder in this level
FOR /F "tokens=*" %%a IN ('DIR /A:D /b') do (
 
	cd %%a
   call :processFolder
   cd ..
   rem If is the target folder, delete it
   if /I "%%a" == "Temp" (
     
   del  /Q "%%a"\*.* 
   )
)
exit /B

Open in new window

bbimisAsked:
Who is Participating?
 
bbimisConnect With a Mentor Author Commented:
I'm looking in scheduled task and I don't see anything that says run hidden.
0
 
Jesus RodriguezIT ManagerCommented:
You can create the automatic task that run the script and set the task to run hidden
0
 
Jesus RodriguezIT ManagerCommented:
What operating system are you Using??
0
 
bbimisAuthor Commented:
worked
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.