Delete files and sub-directories over created over 1 year ago

Hi Josh,
Have a look at this script I got for cleaning up a scans folder.
It's a bit over the top but it works.

Hello,
I have a batch script that runs at the start of every month which clears report files and moves them into an archive directory in a folder with the date of the move. So the archive folder doesn't fill up i want to run a script on it that clears out any folders created over 1 year ago.
I've got:
Set dir="C:\aa_Mine\test\testto"
Echo Deleting all files from %dir%
del %dir%\* /F /Q
Echo Deleting all folders from %dir%
for /d %%p in (%dir%\*) Do rd /Q /S %%p
pause
which deletes all the files and folders in the directory but is there a way only doing it for ones edited over 1 year ago. I tried to add the /minage: command but its not supported.
Any ideas?
Cheers
This topic first appeared in the Spiceworks Community

Similar Messages

  • Deleting Files and (sub)folders - how to

    Hi,
    Easy question. Easy there a vbscript to delete all files and (sub)folders, empty or not. Important, here is that the parent folder must NOT be deleted, only it´s contents. (important: this folder is located on a mapped share \\servername\foldername\)
    please help

    Hi,
    ' Delete All Subfolders and Files in a Folder
    Const DeleteReadOnly = TRUE
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    objFSO.DeleteFile("C:\FSO\*"), DeleteReadOnly
    objFSO.DeleteFolder("C:\FSO\*"),DeleteReadOnly
    Save the above code in test file with .vbs file extension. modify "C:\FSO" to your folder.
    Disclaimer: This posting is provided AS-IS with no warranties or guarantees and confers no rights. Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually
    answer your question. This can be beneficial to other community members reading the thread.

  • Hi, my phone has contacts and photos from over a year ago previously deleted appear on it today. i have not connected to itunes and icloud back up is switched off. can anyone help as its confusing as to which contact numbers are the correct ones . thanks

    Hi, needing advice, my phone today has contacts and photos from nearly a year ago that were deleted. I have not connected to itunes lately and icloud backup is switched off.. Its only annoying as some of my family have changed there phone numbers and now i cannot tell which is the correct number as there are now multiples. Any help would be great. Thanks

    Have you recently added your Facebook credentials? If you haven't synced with your PC recently, this is likely the reason.

  • How do I view the first imessage between a friend and I from over 1 year ago?

    My girlfriend and I have been texting for quite awhile now, over a year to be exact and I was curious on how to see the first imessages we shared between each other whenever we first started talking. I have tried to scroll all the way up but it just freezes and closes out once I get like 2 months back.

    Create your text with no fill or stroke.
    In the Appearance pallette, give your text a fill and (one) stroke of the color you desire. Make the stroke weight what you want the final surrounding stroke to be.
    Then, in the Appearance pallette, with the stroke selected, use the FX menu (see below, circled in red) and go to Path > Offest Path and enter the offset desired.
    --OB

  • Updated operating system and the ipad4th gen froze up and restored it's self and now I lost all my photos and videos from over a year ago,,any way to recover them?

    system restored it's self after a recent operating system upgrade 8.0 and kept shutting down and restarting ,asked to be linked to my mac ,,so I did and it totally reset it's self ,all my apps ,photos and videos are gone from the day I bought the ipad...looked in itunes and I cloud and they are not there,,is it possible to recover all my photos now after a complete restore has happened?

    Do you have a back up?
    If not you're into using file recovery software like  File Salvage - you can download a free trial and it will scan the disk for you and tell you with might be recoverable. Actual recovery will require that you purchase the app. There may be many files with the same or similar names. Always recover the largest file size.
    There are other such apps. Search on Macupdate or the App Store

  • Purchased Creativesuite Premium (CreativeSuite 1.1) over 10 years ago and I have sinced changed my computer. Even though I have transfered all my programs and my files photoshop is now telling me my trial period has ended and I need to register or activat

    Purchased Creativesuite Premium (CreativeSuite 1.1) over 10 years ago and I have sinced changed my computer. Even though I have transfered all my programs and my files photoshop is now telling me my trial period has ended and I need to register or activate my program but I cannot.

    https://helpx.adobe.com/x-productkb/policy-pricing/creative-suite-2-activation-end-life.ht ml
    Mylenium

  • I am trying to open space in my macbook hard drive, so I deleted files and after emptying the trash bin the amount of Gigs didn't increase, why? Where can I go and delete those files?

    I am trying to open space in my macbook hard drive, so I deleted files and after emptying the trash bin the amount of Gigs didn't increase, why? Where can I go and delete those files?

    Did you do a secure empty trash? SHIFT COMMAND DELETE, they will be over wriiten. Are you deleting docs as they aren't much space, videos,pictures,music use much more space.
    You can move those fiels to an external "archive" drive to save them then delete them from your internal drive.

  • HT5085 I have found that at least 3 music videos that I had previously purchased are not available in my I-tunes music video list.  I paid for them over a year ago, why are they not accessible, and why did they just disappear from my lists?

    I have found that at least 3 music videos that I had previously purchased are not available in my I-tunes music video list.  I paid for them over a year ago, why are they not accessible, and why did they just disappear from my lists?

    Have you deleted anything from your iTunes library ? Have you checked to see if they are still on your computer, but not listed in your iTunes library ?
    If not then do they show in the Purchased link under Quicklinks on the right-hand side of the iTunes store homepage for redownloading ? If they don't show there and others do and they are still in your country's store, then check to see if they are hidden : http://support.apple.com/kb/HT4919
    If they are no longer in your store for redownloading (or you aren't in a country where music videos can be redownloaded) then you will need to copy them back from your backup of your library/downloads.

  • Hello, I lost my iphone over a year ago and I haven't been able to get any of the music that I purchased. Is there a way to retrive my music library

    Im wondering how I can get the music that I had on my iphone 4. I lost the phone over a year ago, but I spent hundreds of dollars on music albums. since then I have never been able to find out if I can get the albums that I purchased  and save them in my computer. I don't have a iphone or other cell phone at the moment. the phone that I lost was not backed up. if anyone know how to do that, I would be thrilled.

    If you got them from the iTunes Store, click here for information.
    If you got them from somewhere else, reload them from that source.
    (76303)

  • I recently got a new laptop and i havent downloaded new music for many months off iTunes and i have always used my aunts laptop. I setup up an my itunes sccount but it only showed downloaded music from over two years ago. How to fix it?

    I recentl bought a new laptop and setup my itunes and couldnt remember my account informaion. I got logged in but only 60 of my 750 songs were on there and they were downloaded over 2 years ago on my aunts laptop and that is the only place i have ever downloaded from my itunes. I would like to get new songs but im worried to sync it because it ssays all my music will be removed. Is it possible i have my ipod connected to two accounts? If not can anyone explain what has happend or help me out of this pickle?

    I have tried many things and none of them work i have purchased over 340 songs itunes and id really noy like to lose them all.

  • Jsp code (js code) to display(tree) the files and sub folders in a folder

    Hi all
    plz can any one send me the source in jsp or js to display in tree structure for files and sub folders in a folder.

    There are dozens of Javascript tree widgets available on the Internet. Some are free. Some are good. Google will find them for you.
    (The only relevance of JSP to your question is that yes, you can generate HTML that uses one of those Javascript tree widgets.)

  • Deleted files and photos

    If deleted files and photos even from the bin, is it possible in anyway to take them back without any cost issues?
    Thanks

    It may be possible to recover some erased ones, but you must quit using the Computer immediately, because the OS will think it can write to those freed blocks on the disk.
    Either boot this one in Target mode...
    http://support.apple.com/kb/HT1661
    And recovering from another Mac, or booting this Mac from another HDD, then using Data Rescue...
    http://www.prosofteng.com/products/data_rescue.php
    (Has a Free Demo to see if it could or not, but you'll need another drive to recover to).
    rccharles on file recovery...
    "Stellar Phoenix Macintosh - Mac data recovery software, recovers data from damaged, deleted, or corrupted volumes and even from initialized disks."
    They have a trial version, so I guess you can see if your data can be recovered...
    http://www.stellarinfo.com/mac-data-recovery.htm
    FileSalvage is an extremely powerful Macintosh application for exploring and recovering deleted files from a drive or volume. FileSalvage is designed to restore files that have:
        * been accidentally deleted.
        * become unreadable due to media faults.
        * been stored on a drive before it was re-initialized/formatted.
    http://subrosasoft.com/OSXSoftware/index.php?main_page=product_info&products_id= 1

  • I have an iPhone 5. I got it just over a year ago and the power button recently quit working. Since ive had it for over a year, can i take it in and have it replaced or fixed?

    I got my iPhone 5 a little over a year ago, and my power button recently quit working. Since ive had it for over a year, can i still get it fixed or replaced?

    Wow that is so unlucky. If I was you I would try talking to someone at the Apple Store, explain your situation and don't be shy to shed a tear or too. Its just a shame 3 weeks after your phone getting hardware problems. I know people will say, oh buy Apple Care but I feel ya and I know adding that extra money in the beginning feels pointless and expensive.
    Worst case scenarion like I said you will have to pay Apple 269 for them to swap phones. Or if you have any nerd friends have them fix it for you. Its a tedious repair the way the power button has some weird hinge that needs to snap on and ribbons are so thin. I do not advise for you to attempt to fix your self unless you don't care if you break it completely.
    Alternatively you could just turn on Assisitive touch on accessibility and use that. That way you wont need to pay anything to fix your phone and wont need to take it apart either.

  • I have recently changed to an iMac from a Windows PC. How do I delete files and format the memory card in my helmet cam?

    I have recently changed to an iMac from a Windows PC. How do I delete files and reformat the memory card in my helmetcam?

    If you return the memory card to the helmetcam, it may choose to reformat it before use; back to some FAT-16 or FAT-32 format many of these third-party cards and cameras use. Unless you were going to use it for Mac OS X and format it with HFS+ or in a partition map for Mac data, etc.
    If not, the easiest way to reformat the card may have been in the camera itself. I've formatted several kinds of camera cards, drives, USB flash drive, and others. The means varies with the intended purpose. Sometimes the default is the best; since it is platform neutral if the device is seen by both players.
    Good luck & happy computing!

  • My Macbook Air can delete files and folders and take them to Trash Can but cannot delete from Trash Can . Cannot empty trash securely.

    My Macbook Air can delete files and folders and take them to Trash Can but cannot delete from Trash Can . Cannot empty trash securely.

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Click the Clear Display icon in the toolbar. Then try the action that you're having trouble with again. Select any messages that appear in the Console window. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    When posting a log extract, be selective. In most cases, a few dozen lines are more than enough.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some private information, such as your name, may appear in the log. Anonymize before posting.

Maybe you are looking for

  • Add customer fields using BBP_CUF_BADI

    Hi, I am trying to add my own subscreen to PO Item screen. In order to do that I created a Function Group and assigned my screen to it. the screen contains a push button. In order to display my screen at the PO item I used the PUT_DATA method of badi

  • What takes up 'other' memory??

    on the ipod's memory usage bar on itunes, it has 'audio' and 'other' i have a lot of 'other' memory being taken up what kind of files would be taking up this space? how do i delete it? all i have on my ipod is songs, so that would be the 'audio' memo

  • Looking for LabView 5

    I'm looking for the soft LabView 5.0 for Windows 95 Is anybody could help me to get thise very usefull software ? Thanx K

  • Time and security protecting of PowerPoint presentations

    I would like to know if it's possible to security protect a PowerPoint presentation and to time protect it also. I have seen details of the security protection but not time protection.  Basically, we want to be able to allow use of a presentation whi

  • Adobe Access on iOS.

    This discussion is a follow up of my previous discussion that can be found at http://forums.adobe.com/message/6174242. I am starting a new discussion for clarity. The previous discussion addressed the question of whether Adobe Access DRM and its vari