in

andy vt's tools & blog

automating lazy

Profile steps required for creating a destination folder

Last post 08-17-2010 12:46 PM by masonl. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 08-13-2010 5:54 PM

    Profile steps required for creating a destination folder

    I have a profile currently that moves files from the recorded TV directory to another drive on the same machine once commercial processing is complete. 

    What I'd like to do is create a destination folder with the title of the program if one doesn't already exist to better categorize content.  Is a PowerShell script required for this action or can it be accomplished with native DVRMSTB functionality?  If so how?  If not, does anyone have a PS script I can leverage?

     FWIW, the profile I have currently bombs:

    Move the file in Context["InputFile"] to M:\Processed TV\%cutTitle%
    M:\Processed TV\<Show Title> does not exist
    Action did not complete successfully

     Also, I posted a similar inquiry to this thread in the Profiles forum, but figured I'd start a new one.

  • 08-14-2010 11:28 AM In reply to

    Re: Profile steps required for creating a destination folder

    See here.  I created a simple app for this.

     http://cid-fc502126faae22c3.office.live.com/self.aspx/.Public/DirectoryCreator.zip

    Run it through, run external like this

    C:\Users\Public\Desktop\DirectoryCreator.exe "M:\ProcessedTV\%cutTitle%"

    Where the first part is the app location and the second part is the args.  Should be easy enough to figure out.  Let me know if you have questions.

  • 08-14-2010 6:26 PM In reply to

    Re: Profile steps required for creating a destination folder

    Very cool!  It works great, thanks much! 

     I don't suppose you'd be willing to share the source as well in the event myself and others would like to extend?

  • 08-14-2010 6:46 PM In reply to

    Re: Profile steps required for creating a destination folder

    Sure I'll post tomorrow. It's real basic stuff.
  • 08-15-2010 5:52 AM In reply to

    Re: Profile steps required for creating a destination folder

    I've posted the visual studio solution on the same site.  But really this is the entire code (c#)

     

    using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Text;

    using System.IO;

    namespace Directory_Creator

    {

    class Program

    {

    static void Main(string[ args)

    {

    try

    {

    string directoryIn = args[0];if (Directory.Exists(directoryIn))

    {

    }

    else

    {

    Directory.CreateDirectory(directoryIn);

    }

    }

    catch (Exception e)

    {

    System.
    Console.WriteLine(e);

    }

    }

    }

    }

  • 08-17-2010 12:46 PM In reply to

    Re: Profile steps required for creating a destination folder

    Indeed that is simple.  Thanks for posting! :)

Page 1 of 1 (6 items)
@2008 andy vt
Powered by Community Server (Non-Commercial Edition), by Telligent Systems