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 10 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
Task Schedule err msg: corrupted task image
I don't use Task Scheduler at all and I've seen this err msg before, so I've never bothered to clean that up. But now I want to do that. The err messages are many, each one popping up with a different task name. But eventually the long string of popups end. You have to click the OK button...
Software
Task Scheduler deleting bat file and removing permissions for folder.
I have a simple bat file that launches firefox and runs an in-browser macro that logs me on. It's worked flawlessly, at 7am and 3pm every day. Suddenly today, Task Scheduler launches it and mid-bat file, deletes it. - I tried to copy paste the macro back in and rename it, it tells me I don't have...
General Discussion
Task Schedule issue
Dear All, I am facing issue regarding Task Schedule, I have created a task which runs first time perfectly but it remains in running condition. I am unable to understand why it happening. Actually i created a .bat file which runs a crystal report and i scheduled this file weekly for (Monday,...
General Discussion
Deleting Content.IE5 content
I have about 83GB of useless data trapped in C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\Z1O6OK0R, DQ1O7FJH, etc. This is not to be confused with C:\Users\Owner\AppData\Local\Microsoft\Windows\Temporary Internet Files. The only way I...
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


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 01:56.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App