Solved

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

Posted on 2015-01-22
4
436 Views
Last Modified: 2015-01-28
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

0
Comment
Question by:bbimis
  • 2
  • 2
4 Comments
 
LVL 13

Expert Comment

by:Jesus Rodriguez
Comment Utility
You can create the automatic task that run the script and set the task to run hidden
0
 

Accepted Solution

by:
bbimis earned 0 total points
Comment Utility
I'm looking in scheduled task and I don't see anything that says run hidden.
0
 
LVL 13

Expert Comment

by:Jesus Rodriguez
Comment Utility
What operating system are you Using??
0
 

Author Closing Comment

by:bbimis
Comment Utility
worked
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now