Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2015-01-22
4
Medium Priority
?
481 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This is a fine trick which I've found useful many times, when you just don't want to accidentally run a batch script or the commands needs administrator rights.
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…
Progress

660 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