Advertisement

04.28.2008 at 06:40AM PDT, ID: 23358643
[x]
Attachment Details

Move newest file from network drive

Asked by judsonhh in Windows 2003 Server

Tags: , , , , , , ,

I tried this code to move the "newest" file in a network folder.

set sourcedir=c:\backups
set destdir=D:\archive

for /f "tokens=*" %%a in ('dir /b /a-d /o-d "%sourcedir%\*.*"') do set filename=%%a & goto :next
:next

move "%filename%" "%destdir%"

Problem is, it just copies ALL files in the folder. Evidently this method does not work across a network. Any other methods that may work. Any option that will process on Windows 2003 Server is conciderable.
Start Free Trial
[+][-]04.28.2008 at 06:46AM PDT, ID: 21453874

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.28.2008 at 06:48AM PDT, ID: 21453911

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.28.2008 at 07:00AM PDT, ID: 21454034

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.28.2008 at 07:31AM PDT, ID: 21454330

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.28.2008 at 08:26AM PDT, ID: 21454886

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Windows 2003 Server
Tags: batch, vbs, script, network, file, process, move, copy
Sign Up Now!
Solution Provided By: Shift-3
Participating Experts: 2
Solution Grade: A
 
 
[+][-]04.28.2008 at 12:12PM PDT, ID: 21456748

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906