Re: Script to move oldest .ready file

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On Sep 24, 8:13 am, "Pegasus \(MVP\)" <I....@xxxxxxxxxx> wrote:
<dbthomso...@xxxxxxxxx> wrote in message

news:f4d2f0c9-fe9c-4751-a71c-68c8988163e6@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

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.

Thanks! Much appreciated.

.



Relevant Pages

  • Re: WinXP. Unable to map home drive. Maps to root of share only.
    ... The \0 folder does exist - I will try to explain further... ... test it would work like a dream - but that would mean the server having ... > Your question about my second batch file is justified. ... >> I don't quite understand the 2nd script because its mapping to the ...
    (microsoft.public.win2000.networking)
  • Re: User - Group - Shared Folder
    ... You can use the same batch file, place it on a network share, but use GPO instead, make sure that the group that you want to apply the script has read and apply permissions to that GPO, remove the authenticated users apply permissions to that new GPO. ... On file server I made Shared Folder called "Accounting". ...
    (microsoft.public.windows.server.active_directory)
  • Re: Logon script not running
    ... > F is a share of a folder located in a Windows 2000 Server. ... > assign it through the script. ... > administrator account, it works fine. ... > 2.- My batch file does not run, but any other I have tried does. ...
    (microsoft.public.win2000.networking)
  • Re: Mapped Network Drives on login for Specific Users Only
    ... You must have a folder to which the share points. ... Testing your concept by logging on and waiting for the login script to do ... In my master login batch file I updated the ...
    (microsoft.public.win2000.networking)
  • Re: Setting Permissions to Home folders
    ... Instead of running this manually as batch file can we run this in scheduled ... I have this script which works but i need to specify the home name other ... but the script doesnt assign any permissions to the folder. ... and if user id matches with home folder name it has to assign full access ...
    (microsoft.public.windows.server.scripting)