how to script moving files from unknown folders ?

Discussion in 'Computer Support' started by Drew, Feb 27, 2009.

  1. Drew

    Drew Guest

    hello all,
    I need some help with a batch file or vb script....

    Long story :
    I use a program called Juice to download podcast mp3 files,
    All the mp3 files get downloaded into
    C:\podcasts\[NAME OF PODCAST]\filename.mp3

    with [NAME OF PODCAST] be a wild card or unknown (so I don't have to change
    the script if I add or remove a podcast)
    I want a script to run from the C:\podcasts folder and look at the 20+
    subfolders and move all mp3 files to C:\podcasts


    anyway hope that makes some kind of since


    Thanks
    ~Andrew
     
    Drew, Feb 27, 2009
    #1
    1. Advertising

  2. Drew

    why? Guest

    On Thu, 26 Feb 2009 21:58:57 -0600, Drew wrote:

    >hello all,
    >I need some help with a batch file or vb script....
    >
    >Long story :
    >I use a program called Juice to download podcast mp3 files,
    >All the mp3 files get downloaded into
    >C:\podcasts\[NAME OF PODCAST]\filename.mp3


    Well you could try changing the Juice download folder to

    c:\podcasts\downloads\[NAME OF PODCAST]

    Then the path isn't unknown, it's 'downloads'.

    >with [NAME OF PODCAST] be a wild card or unknown (so I don't have to change
    >the script if I add or remove a podcast)
    >I want a script to run from the C:\podcasts folder and look at the 20+
    >subfolders and move all mp3 files to C:\podcasts


    Ok, so it's Perl but it's also very powerful.
    http://perl.about.com/od/filesystem/qt/perlglob.htm
    glob the file/directory structure and look at dates/times , file
    extensions.

    >
    >anyway hope that makes some kind of since


    Yes, so does this, searching previous posts in 24HSHD about scripting.
    http://groups.google.com/group/24hoursupport.helpdesk/topics
    several sites with lots of examples. Look for batch files , nt batch
    files, microsoft vb scripting.

    MS have a huge amount of info on scripting,
    http://www.microsoft.com/technet/scriptcenter/default.mspx
    there are lots of (MS or non-MS)scripting tutorials, just look.

    Me
     
    why?, Feb 27, 2009
    #2
    1. Advertising

  3. Drew wrote:

    > hello all,
    > I need some help with a batch file or vb script....
    >
    > Long story :
    > I use a program called Juice to download podcast mp3 files,
    > All the mp3 files get downloaded into
    > C:\podcasts\[NAME OF PODCAST]\filename.mp3
    >
    > with [NAME OF PODCAST] be a wild card or unknown (so I don't have to
    > change the script if I add or remove a podcast)
    > I want a script to run from the C:\podcasts folder and look at the 20+
    > subfolders and move all mp3 files to C:\podcasts
    >
    >
    > anyway hope that makes some kind of since
    >

    c:
    cd \podcasts
    for /R %I in ( *.mp3 ) do copy "%I" .
     
    wisdomkiller & pain, Feb 27, 2009
    #3
  4. wisdomkiller & pain wrote:

    ....
    > c:
    > cd \podcasts
    > for /R %I in ( *.mp3 ) do copy "%I" .


    Uhm, that's how I tried out :)
    Instead of copy, use "move" for your purpose.
     
    wisdomkiller & pain, Feb 27, 2009
    #4
  5. Drew

    why? Guest

    On Thu, 26 Feb 2009 21:58:57 -0600, Drew wrote:

    >hello all,
    >I need some help with a batch file or vb script....
    >
    >Long story :
    >I use a program called Juice to download podcast mp3 files,
    >All the mp3 files get downloaded into
    >C:\podcasts\[NAME OF PODCAST]\filename.mp3
    >

    <snip>

    Previous posts mention xxcopy, kix script, nt/2000/xp resource kits, you
    can possibly get forfiles

    http://technet.microsoft.com/en-us/library/cc753551.aspx
    Selects and executes a command on a file or set of files. This command
    is useful for batch processing.

    I also forgot about robocopy earlier.

    Me
     
    why?, Feb 27, 2009
    #5
  6. Drew

    why? Guest

    On Fri, 27 Feb 2009 21:33:38 +0100, wisdomkiller & pain wrote:

    >wisdomkiller & pain wrote:
    >
    >...
    >> c:
    >> cd \podcasts
    >> for /R %I in ( *.mp3 ) do copy "%I" .

    >
    >Uhm, that's how I tried out :)
    >Instead of copy, use "move" for your purpose.


    Also remember, %I on cmd line and %%I in a batch file.

    Me
     
    why?, Feb 27, 2009
    #6
  7. Drew

    Drew Guest

    Thanks guys, this is what I got to work....

    @echo off
    set Pods=c:\podcasts\
    for /f "delims=" %%a in (
    'dir "%Pods%*.*" /b /s'
    ) do if /I "%%~dpa" NEQ "%Pods%" move "%%a" "%Pods%"

    cd\podcasts
    for /d %%i in (*) do rd "c:\podcasts\%%i\" /s /q

    Thanks a again.
    ~Andrew


    "why?" <fgrirp*sgc@VAINY!Qznq.fpvragvfg.pbz> wrote in message
    news:...
    >
    > On Thu, 26 Feb 2009 21:58:57 -0600, Drew wrote:
    >
    >>hello all,
    >>I need some help with a batch file or vb script....
    >>
    >>Long story :
    >>I use a program called Juice to download podcast mp3 files,
    >>All the mp3 files get downloaded into
    >>C:\podcasts\[NAME OF PODCAST]\filename.mp3
    >>

    > <snip>
    >
    > Previous posts mention xxcopy, kix script, nt/2000/xp resource kits, you
    > can possibly get forfiles
    >
    > http://technet.microsoft.com/en-us/library/cc753551.aspx
    > Selects and executes a command on a file or set of files. This command
    > is useful for batch processing.
    >
    > I also forgot about robocopy earlier.
    >
    > Me
     
    Drew, Feb 28, 2009
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?PHNjcmlwdD5hbGVydCgpOzwvc2NyaXB0Pg==?= a

    <script>alert();</script>

    =?Utf-8?B?PHNjcmlwdD5hbGVydCgpOzwvc2NyaXB0Pg==?= a, Apr 13, 2004, in forum: Microsoft Certification
    Replies:
    0
    Views:
    7,869
    =?Utf-8?B?PHNjcmlwdD5hbGVydCgpOzwvc2NyaXB0Pg==?= a
    Apr 13, 2004
  2. peiper

    Moving files and folders

    peiper, Dec 12, 2003, in forum: Computer Support
    Replies:
    5
    Views:
    414
    Brian H¹©
    Dec 12, 2003
  3. Kenny

    Unknown Video TS folders?

    Kenny, Sep 15, 2004, in forum: Computer Support
    Replies:
    4
    Views:
    677
    Paul - xxx
    Sep 15, 2004
  4. nadiralishah
    Replies:
    0
    Views:
    1,200
    nadiralishah
    Jan 6, 2008
  5. Mike
    Replies:
    5
    Views:
    1,894
    chuckcar
    Mar 28, 2008
Loading...

Share This Page