Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Computing > Computer Support > how to script moving files from unknown folders ?

Reply
Thread Tools

how to script moving files from unknown folders ?

 
 
Drew
Guest
Posts: n/a
 
      02-27-2009
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

 
Reply With Quote
 
 
 
 
why?
Guest
Posts: n/a
 
      02-27-2009

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/24hou...elpdesk/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/scr...r/default.mspx
there are lots of (MS or non-MS)scripting tutorials, just look.

Me
 
Reply With Quote
 
 
 
 
wisdomkiller & pain
Guest
Posts: n/a
 
      02-27-2009
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" .
 
Reply With Quote
 
wisdomkiller & pain
Guest
Posts: n/a
 
      02-27-2009
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.
 
Reply With Quote
 
why?
Guest
Posts: n/a
 
      02-27-2009

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/l.../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
 
Reply With Quote
 
why?
Guest
Posts: n/a
 
      02-27-2009

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
 
Reply With Quote
 
Drew
Guest
Posts: n/a
 
      02-28-2009
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:(E-Mail Removed)...
>
> 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/l.../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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
zipping files folders and sub folders w/ winzip or winrar Mike Computer Support 5 03-28-2008 09:10 PM
Free Moving Estimate, Local Movers, Long Distance Moving, PackingSupplies, Storage Rental, Home Moving, Apartment Moving, Office Moving,Commercial Moving linkswanted ASP .Net 0 01-06-2008 04:45 AM
how to read txt files in unknown folders zl2k C++ 2 03-30-2007 09:36 AM
Moving files and folders peiper Computer Support 5 12-12-2003 10:33 PM



Advertisments