Solved

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

Posted on 2015-01-22
4
464 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
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This is about my first experience with programming Arduino.
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…

733 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