Computing.Net > Forums > Windows 2000 > script to copy file in a directory

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

script to copy file in a directory

Reply to Message Icon

Name: jay
Date: September 4, 2003 at 09:31:19 Pacific
OS: win2k
CPU/Ram: P4,1GB
Comment:

how can i use a script to copy the newest file in a directory? i.e. I have a number of files with similar names (SCAN1,SCAN2,etc) the highest index is the newest file and there can be a maximum of 150 of these files. I dont want to copy all of them because they are fairly large and at some point there could be 150 of these files, but I just want the most recent one.

Thanks,

J



Sponsored Link
Ads by Google

Response Number 1
Name: Analyst
Date: September 4, 2003 at 12:39:56 Pacific
Reply:

I don't know of any script commands that can use Windows built in capabilities to do that, if it has any, but Analog X has a command line utility called New Move that sounds like it has what you need.

http://www.analogx.com/contents/download/system.htm


0

Response Number 2
Name: scoura
Date: September 7, 2003 at 01:29:58 Pacific
Reply:

Try these commands...

DIR [SOURCEDIR] /A:-D /B /O:D > SCANLIST.TXT

FOR /F %%I IN (SCANLIST.TXT) DO SET SCANFILE=%%I

COPY /Y %SCANFILE% [DESTINATIONDIR]

How's that?


0

Response Number 3
Name: scoura
Date: September 8, 2003 at 03:29:03 Pacific
Reply:

Whoops, looks like I made a few mistakes, but you get the idea...


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Modem Problems Appletalk not seen printe...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows 2000 Forum Home


Sponsored links

Ads by Google


Results for: script to copy file in a directory

copying files with Task Scheduler www.computing.net/answers/windows-2000/copying-files-with-task-scheduler-/63510.html

Help needed to distribute files www.computing.net/answers/windows-2000/help-needed-to-distribute-files-/58734.html

xcopy to grab latest files in a dir www.computing.net/answers/windows-2000/xcopy-to-grab-latest-files-in-a-dir/62640.html