![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| | #2 (permalink) |
| | 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! 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 Specs![]() |
| | #3 (permalink) |
| | 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. |
My System Specs![]() |
| | #4 (permalink) |
| | 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 for the feedback. |
My System Specs![]() |
![]() |
| 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 | |||