Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Need help creating a task scheduler task to move files over a network.


31 Mar 2011   #1

Windows 7 Home Premium 64bit
 
 
Need help creating a task scheduler task to move files over a network.

Hello everyone,

I need to have a task run that will move the contents of a folder from one computer to another over my home LAN. Files get downloaded during the night on one computer and then need to be transfered to another. Usually I am doing this by hand, but then though maybe I could get the task scheduler to do it for me.
I understand how to create a task, however I am having trouble with the action tab. I was thinking that I should start windows explorer (where is explorer located for win 7 x64 machines?) under the action tab, but once I do this I am not sure how to tell explorer to check the source folder, select all the files in it and then move it to the target folder.

I took a look through the tutorials of the forum, but didn't find what I was looking for. If you can help or just point me to more resources that would get me going I would be thankful.

Thanks in advance.
Steve

My System SpecsSystem Spec
.

31 Mar 2011   #2

Windows 8 Core X64
 
 

So you have two computers, A and B.

A gets the downloads and they are in C:\Downloads (for example).

The name of computer A is CompA and the name of the share for C:\Downloads is Downloads.

You want to move them to computer B in C:\Otherfolder (for example)

If the folder names will always be the same then you can use the move command directly from the scheduled task. You set this up on computer B.

Open Task Scheduler
Under Action, Create basic Task
Name: Move Download Files
Description: Move files downloaded overnight from Computer A to Computer B
Click Next
Select Daily
Click Next
Set date and time
Click Next
Select Start a program
Click Next
In Program/Script box, enter: cmd

In the Arguments box, enter: /c m
ove /Y \\CompA\Downloads\*.* C:\Otherfolder
Click Next
Check the results then click Finish

When this runs, a Command Prompt window will open, the move will take place then the window will close. If you want it to stay open so you can see the results, change /c to /k.

If you want this to run when you're not logged on then under the General tab of Task Scheduler, select Run whether user is logged on or not.

You could also set this up on Computer A by changing things a bit.



My System SpecsSystem Spec
01 Apr 2011   #3

Windows 7 Home Premium 64bit
 
 

Thanks for the help ztrucker. So I need to create the task on the machine that has the files initially as the receiving computer does not have access to the drive of the initiating computer (Computer A gets the files, Computer B needs the files, but computer B does not have access to Computer A's drive. Computer A has access to the drives on computer B. I can manually drag and drop files from computer A to computer B).
Under the action I put to start a program and typed cmd into the program box (I didn't include a path, but I don't think that you need to with this command). I tried to swap things around a little. Can you take a look at this and tell me if you think that there are any problems with this line? For some reason when I tried to run the task it said running, but no files moved.

/c move /Y D:\Downloads\TV Torrent DL\Converted\*.* \\Pedro\Hp.Windows 7.MX300EIDE.F\Converted Video

Thanks for the help
Steve
My System SpecsSystem Spec
.


01 Apr 2011   #4

Windows 7 Home Premium 64bit
 
 

After some playing around I decided to try just moving 1 file (there was only 1 file in the initial folder) to the folder that is above it. I figured that if the move command worked to do this then the problem was else where. So in a command window I typed the following. I used windows explorer to generate the directories so that I would not make a typing mistake. For some reason it tells me that the syntax isn't correct

C:\Users\Kira>move/Y D:\Downloads\TV Torrent DL\Converted\*.* D:\Downloads\TV Torren
t DL
The syntax of the command is incorrect.

I guess I need help with this first then once I get this figured out can use it in the task scheduler.

BTW, I am running windows 7 x64 SP1.

Steve
My System SpecsSystem Spec
01 Apr 2011   #5

Windows 7 Home Premium 64bit
 
 

One more update. I tried the following and get a different error message. I switched to the folder where the file resides in case that was causing a problem.

D:\Downloads\TV Torrent DL\Converted>move/Y D:\Downloa~\TV Torr~\Convert~\*.* D:\Downloa~\TV Torr~

The system cannot find the file specified

Hope this can help you trouble shoot this with me. Thanks

Steve
My System SpecsSystem Spec
01 Apr 2011   #6

Windows 8 Core X64
 
 

Put a space between move and the /Y:

move /Y D:\Downloa~\TV Torr~\Convert~\*.* D:\Downloa~\TV Torr~

or use full names enclosed in double quotes:

move /Y "D:\Downloads\TV Torrent DL\Converted\*.*" "D:\Downloads\TV Torrent DL"
My System SpecsSystem Spec
01 Apr 2011   #7

Windows 7 Home Premium 64bit
 
 

Thanks! Both those ideas did the trick. Here are the results of two tests

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Kira>move /Y "D:\Downloads\TV Torrent DL\Converted\*.*" "D:\Downloads\T
V Torrent DL
D:\Downloads\TV Torrent DL\Converted\HD 720p_ The Walking Dead S01E01 720p HDTV
x264-CTU.ipodtouch.mp4
1 file(s) moved.


I then moved the file back and tried to move it to the other computer

C:\Users\Kira>move /Y "D:\Downloads\TV Torrent DL\Converted\*.*" "\\PEDRO\Hp.Win
7.MX300EIDE.F\Converted Video"
D:\Downloads\TV Torrent DL\Converted\HD 720p_ The Walking Dead S01E01 720p HDTV
x264-CTU.ipodtouch.mp4
1 file(s) moved.

It took a little while as this file is 640mb, but it worked!

I also got the task schedule to fire correctly and move the file.

Thanks for the help. If you can help me with the next step that would be a bonus, but if not I can just leave it as is.

Is there a way to get this task to fire on an event say when a file is downloaded into the first folder? That way a timer would not be needed. I'm not sure if there is an event that would work to trigger something like this.

Thanks again for the help.

Steve
My System SpecsSystem Spec
01 Apr 2011   #8

Windows 8 Core X64
 
 

You could probably do it with a never ending batch file that wakes up every so often, check to see if the file is there and if yes, move it.

If it's not always the same filename then this gets a lot harder, at least from a batch file perspective. Doable but I'd need to think about it more.

What are you using to download the file? Perhaps it has the capability to launch a program or script when it completes?
My System SpecsSystem Spec
01 Apr 2011   #9

Windows 8 Core X64
 
 

Something like this works for me:
Code:
@echo off

:WaitMore

Rem Now check To see If there  are any files in the
Rem download directory to be moved.
For %%A in ("D:\Downloads\TV Torrent DL\Converted\*.*") Do move /Y "%%A" "\\PEDRO\Hp.Windows 7.MX300EIDE.F\Converted Video"

Rem Wait 30 minutes
timeout /t 1800
goto WaitMore
Put a link to this in your Startup folder and it will launch at boot time. If you want it to wait before doing anything, move the timeout to the beginning.
My System SpecsSystem Spec
12 Jul 2012   #10

OS
 
 

ROBOCOPY.EXE is included with Windows 7 (Server 2008...)

I use ROBOCOPY.EXE and the /MOT switch for this:

C:\Windows\System32\Robocopy.exe "d:\data\SharedFiles\Dropbox" "\\otherserver\Backups\DropboxBackup" /s /e /r:0 /w:0 /MOT:5

In the string above, it checks for changes in the source directory every 5 minutes.

ROBOCOPY.EXE /?
My System SpecsSystem Spec
Reply

 Need help creating a task scheduler task to move files over a network.




Thread Tools




Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 05:04 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33