How to Schedule Folder Content Deleting Task

Page 1 of 3 123 LastLast

  1. Posts : 30
    Windows 7
       #1

    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 Computer


  2. Posts : 5,642
    Windows 10 Pro (x64)
       #2

    With Task Scheduler of course...
    Something else you need?
      My Computer


  3. Posts : 1,814
    XP / Win7 x64 Pro
       #3

    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 Computer


  4. Posts : 30
    Windows 7
    Thread Starter
       #4

    thanks a lot.... i love this forum
      My Computer


  5. Posts : 1,814
    XP / Win7 x64 Pro
       #5

    No problem.
      My Computer


  6. Posts : 30
    Windows 7
    Thread Starter
       #6

    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 Computer


  7. Posts : 150
    Windows 7 Ultimate x64, BackTrack Linux 5 R2, Windows XP
       #7

    mnr367 said:
    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 Computer


  8. Posts : 30
    Windows 7
    Thread Starter
       #8

    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 Computer


  9. Posts : 150
    Windows 7 Ultimate x64, BackTrack Linux 5 R2, Windows XP
       #9

    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 Computer


  10. Posts : 30
    Windows 7
    Thread Starter
       #10

    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 Computer


 
Page 1 of 3 123 LastLast

  Related Discussions
Our Sites
Site Links
About 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 10:48.
Find Us