Solved

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

Posted on 2015-01-22
4
475 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 13

Expert Comment

by:Jesus Rodriguez
ID: 40564576
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
ID: 40564852
I'm looking in scheduled task and I don't see anything that says run hidden.
0
 
LVL 13

Expert Comment

by:Jesus Rodriguez
ID: 40564972
What operating system are you Using??
0
 

Author Closing Comment

by:bbimis
ID: 40574832
worked
0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

617 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