Computing.Net > Forums > Programming > Batch script Help

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.

Batch script Help

Reply to Message Icon

Name: b123rich
Date: March 1, 2005 at 11:45:48 Pacific
OS: win2000
CPU/Ram: intel processor
Comment:

I need of a batch script that searches a directory for a text file w/ the most recent date modified. It then copies that file to a new directory.

b123rich



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: March 1, 2005 at 12:15:56 Pacific
Reply:

Hi rich,

Try this:

::**
dir *.txt /o-d /b > newest.lst
set /p latest=< newest.lst
copy %latest% s:\
del newest.lst
::**


M2


0

Response Number 2
Name: b123rich
Date: March 2, 2005 at 07:03:55 Pacific
Reply:

::**
dir c:\ohiosubpaytest\*.txt /o-d /b > newest.lst
set /p latest=< newest.lst
copy %latest% j:\currentweek.TXT
del newest.lst
::**

I tried this and I am getting an err or after "copy %latest% j:\currentweek.TXT" that 'system cannot find the file specified'

Please help.....


b123rich


0

Response Number 3
Name: Guy
Date: March 2, 2005 at 14:22:34 Pacific
Reply:

Change:

copy %latest% j:\currentweek.TXT

to:

copy c:\ohiosubpaytest\%latest% j:\currentweek.TXT



0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch script Help

Batch Script Help Needed www.computing.net/answers/programming/batch-script-help-needed/14475.html

Simple Batch Script help www.computing.net/answers/programming/simple-batch-script-help/12744.html

Batch Script Help and Suggestions www.computing.net/answers/programming/batch-script-help-and-suggestions/14552.html