Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Script to move oldest .ready file

Reply
 
Old 09-24-2008   #1 (permalink)
dbthomson76


 
 

Script to move oldest .ready file

Hi,

I need to create a script that will move the oldest .ready file in a
specific directory to another specific directory.

Can anyone help me create a script?

TIA!

My System SpecsSystem Spec
Old 09-24-2008   #2 (permalink)
Pegasus \(MVP\)


 
 

Re: Script to move oldest .ready file


<dbthomson76@xxxxxx> wrote in message
news:f4d2f0c9-fe9c-4751-a71c-68c8988163e6@xxxxxx
Quote:

> Hi,
>
> I need to create a script that will move the oldest .ready file in a
> specific directory to another specific directory.
>
> Can anyone help me create a script?
>
> TIA!
You could re-invent the wheel and write a script to compare the various file
dates with each other or else you could rely on standard system tools and do
the job with this batch file:
@echo off
set Source=d:\Some Folder
set Target=c:\Some other folder
for /F "delims=" %%a in ('dir /b /o-d "%Source%\*.ready"') do set File=%%a
echo Moving "%Source%\%File%" to "%Target%"
rem move /y "%Source%\%File%" "%Target%"

Remove the word "rem" in the last line to activate the batch file.


My System SpecsSystem Spec
Old 09-24-2008   #3 (permalink)
DBT


 
 

Re: Script to move oldest .ready file

On Sep 24, 8:13*am, "Pegasus \(MVP\)" <I....@xxxxxx> wrote:
Quote:

> <dbthomso...@xxxxxx> wrote in message
>
> news:f4d2f0c9-fe9c-4751-a71c-68c8988163e6@xxxxxx
>
Quote:

> > Hi,
>
Quote:

> > I need to create a script that will move the oldest .ready file in a
> > specific directory to another specific directory.
>
Quote:

> > Can anyone help me create a script?
>
Quote:

> > TIA!
>
> You could re-invent the wheel and write a script to compare the various file
> dates with each other or else you could rely on standard system tools anddo
> the job with this batch file:
> @echo off
> set Source=d:\Some Folder
> set Target=c:\Some other folder
> for /F "delims=" %%a in ('dir /b /o-d "%Source%\*.ready"') do set File=%%a
> echo Moving "%Source%\%File%" to "%Target%"
> rem move /y "%Source%\%File%" "%Target%"
>
> Remove the word "rem" in the last line to activate the batch file.
Thanks! Much appreciated.

My System SpecsSystem Spec
Old 09-24-2008   #4 (permalink)
Pegasus \(MVP\)


 
 

Re: Script to move oldest .ready file


"DBT" <dbthomson76@xxxxxx> wrote in message
news:596556ef-3070-4150-ae1a-847a4fe2d87d@xxxxxx
On Sep 24, 8:13 am, "Pegasus \(MVP\)" <I....@xxxxxx> wrote:
Quote:

> <dbthomso...@xxxxxx> wrote in message
>
> news:f4d2f0c9-fe9c-4751-a71c-68c8988163e6@xxxxxx
>
Quote:

> > Hi,
>
Quote:

> > I need to create a script that will move the oldest .ready file in a
> > specific directory to another specific directory.
>
Quote:

> > Can anyone help me create a script?
>
Quote:

> > TIA!
>
> You could re-invent the wheel and write a script to compare the various
> file
> dates with each other or else you could rely on standard system tools and
> do
> the job with this batch file:
> @echo off
> set Source=d:\Some Folder
> set Target=c:\Some other folder
> for /F "delims=" %%a in ('dir /b /o-d "%Source%\*.ready"') do set File=%%a
> echo Moving "%Source%\%File%" to "%Target%"
> rem move /y "%Source%\%File%" "%Target%"
>
> Remove the word "rem" in the last line to activate the batch file.
Thanks! Much appreciated.

===============

Thanks for the feedback.


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Must I move the AD Groups I've created to the Default location so my script can see them, or is there another way...? VB Script
Script to move files if a subfolder exists PowerShell
Move computer in AD based on DSQUERY script syntax help! VB Script
problem passing args to script 'There is no script engine for file extenstion' VB Script
keep deleting oldest file in a directory PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46