Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: How to Schedule Folder Content Deleting Task

13 Jun 2012   #1
mnr367

Windows 7
 
 
How to Schedule Folder Content Deleting Task

In my office , a program to launch we need to deleted the contents of the folder
C: users >local> app data > isolated stoarge > Delete Contents.

How can i schedule this Task . so no need to go to every system and delete this files automatically.


My System SpecsSystem Spec
.

13 Jun 2012   #2
logicearth

Windows 8.1 Pro (x64)
 
 

With Task Scheduler of course...
Something else you need?
My System SpecsSystem Spec
13 Jun 2012   #3
FliGi7

XP / Win7 x64 Pro
 
 

Create a .bat file with whatever name you like and the following line inside (where the path given is the one with the files you'd like to delete):

del /F /Q "C:\Users\Local\AppData\Isolated Storage\Delete Contents\*.*"

Then, create a new task to run that batch file at whatever interval you'd like.

Task Scheduler - Create New Task
My System SpecsSystem Spec
.


14 Jun 2012   #4
mnr367

Windows 7
 
 

thanks a lot.... i love this forum
My System SpecsSystem Spec
14 Jun 2012   #5
FliGi7

XP / Win7 x64 Pro
 
 

No problem.
My System SpecsSystem Spec
18 Jun 2012   #6
mnr367

Windows 7
 
 

i tried creating a .bat file using the same code.
My user name is ' vasan ' so i write it like
-- del /F /Q "C:\Users\vasan\AppData\Local\IsolatedStorage\Delete Contents\*.*" --
But its not deleting the contents of the folder.

Is the code correct? do it need to be tweaked to make it actually delete the contents..
My System SpecsSystem Spec
18 Jun 2012   #7
doubled822

Windows 7 Ultimate x64, BackTrack Linux 5 R2, Windows XP
 
 

Quote   Quote: Originally Posted by mnr367 View Post
i tried creating a .bat file using the same code.
My user name is ' vasan ' so i write it like
-- del /F /Q "C:\Users\vasan\AppData\Local\IsolatedStorage\Delete Contents\*.*" --
But its not deleting the contents of the folder.

Is the code correct? do it need to be tweaked to make it actually delete the contents..
If you want to delete the contents of the IsolatedStorage folder, then remove the \Delete Contents\ piece from the code, so it reads "C:\Users\vasan\AppData\Local\IsolatedStorage\*.*"

Also, if you wanted this task to run silently (for a login script), you'll have to create a VBS file with the following code. Copy and paste this into a text file and change the path to point to your batch file, and save the text file as .vbs:

Code:
dim shell
set shell=createobject("wscript.shell")
shell.run "\\someserver\netlogon\locationofBATfile.bat"
set shell=nothing
Then, in your Group Policy (if you're working in a Windows domain), add the new VBS script to your Login Scripts.

If you're still having problems with it deleting it could be due to file permissions. If you push this via GPO, it should run under the System/Network account and should delete.
My System SpecsSystem Spec
19 Jun 2012   #8
mnr367

Windows 7
 
 

Hey bro i tried changing the code to what u show... it still not deleting the contents.. i checked file permissions its all set to allow ....

I am an intern .... i don't have any experience with VB Scripts

One thing i noticed .... i scheduled a disk cleanup during system logon.... the cleanup process take place during every logon but its not erasing any temporary files & the files in the Recycle bin......

What else is left to do...
My System SpecsSystem Spec
19 Jun 2012   #9
doubled822

Windows 7 Ultimate x64, BackTrack Linux 5 R2, Windows XP
 
 

I just ran a test batch with the above information and realized it only deletes contents in the parent folder. So, if you have subfolders in the folder you want to clear, they won't delete with this batch.

Here is a link that may help you.
Create Batch file to delete files and subfolders, but not root folder
My System SpecsSystem Spec
19 Jun 2012   #10
mnr367

Windows 7
 
 

Bro this is the code that i got

set folder="C:\test"
cd /d %folder%
for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q)

I don't have much experience with these code..... can you please make it simple for me ....
My System SpecsSystem Spec
Reply

 How to Schedule Folder Content Deleting Task




Thread Tools





Similar help and support threads
Thread Forum
Windows 7 schedule Task
Hi, Currently having some problem on the schedule job task on windows 7. example script in my bat file as list below. so we schedule and it run only thing is it did not show the dos windows for us to reply message. kindly help. Thanks echo on said Hello pause.
General Discussion
Schedule a task for when computer is idle
Hello guys, I'm having difficulties scheduling a task for when computer is idle. What I want to do is run a task after the computer has been idle for five minutes. I've tried creating a scheduled task in different ways, which will do this, but to no avail. I go to Task scheduler to create a...
Performance & Maintenance
how to set a schedule task to run chkdsk
I tried to to set a schedule task to run chkdsk with a batch file, such as follwoing: echo y|chkdsk C: /F /R shutdown -r I run it on cmd.exe it needs administrator privilege. I run cmd.exe as administrator, then it works. I tried to run it on schedule task and set run by a administrator type...
General Discussion
Schedule a task
I want the computer to execute the following line: mms://wamu-wm.streamguys.com/WAMU-1 at 7:00 am until 10 am Monday through Friday. Unconditionally. I have explored the task menus ad-nausium... and still it does not trigger. There are simply too many options to list them here to...
Customization
How do I schedule a Windows task to run in the foreground?
How do I force a scheduled task to run as a foreground window, to capture the focus when it runs? I wrote a little Delphi app to open a reminder window, but when I schedule it the silly window stays in the background, behind the other 50 windows I routinely have open, and I'm likely to miss it....
Software
Can I schedule a XP Mode task from Win 7?
I have a very old legacy app that would not run or install in Win 7 compatibility mode. I download the Windows VM patch, and the XP Mode application, installed them, and was able to get the application to run. Following some information I found here, I was able to get it pinned to the start menu...
Virtualization

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 16:59.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App