Automic Workload Automation

  • 1.  Elegant way to check if a folder exists (windows).. anyone?

    Posted Nov 29, 2013 08:27 PM

    I'm building a solve-all archiving job, with calendar keywords, options to move or delete, based on file age.  I want to add the option to create subfolders by year (2013, 2014) if they dont exist already.

    Can you think of an cool way to do this?  I already know I could do it, but I somebody already has done this, please save me the trouble of thinking.



  • 2.  Elegant way to check if a folder exists (windows).. anyone?
    Best Answer

    Posted Dec 05, 2013 05:36 AM

     

    Issue Dir /AD which will get you a list of directories

    Do a PREP_PROCESS_REPORT with a filter on the diary you want



  • 3.  Elegant way to check if a folder exists (windows).. anyone?

    Posted Dec 05, 2013 11:58 AM

    In a DOS batch file, you can test if the directory already exists with this construct:

         IF EXIST 2013\nul echo "Directory 2013 already exists"

    So reversing that logic, you can create the directory if it doesn't exist yet:

         IF NOT EXIST 2013\nul MKDIR 2013