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

Page 1 of 2 12 LastLast

  1. Posts : 51
    Windows 7 Home Premium 64bit
       #1

    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 Computer


  2. Posts : 6,285
    Windows 10 Pro X64
       #2

    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 Computer


  3. Posts : 51
    Windows 7 Home Premium 64bit
    Thread Starter
       #3

    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.Win7.MX300EIDE.F\Converted Video

    Thanks for the help
    Steve
    Last edited by nzdreamer55; 01 Apr 2011 at 17:28. Reason: needed more explination
      My Computer


  4. Posts : 51
    Windows 7 Home Premium 64bit
    Thread Starter
       #4

    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 Computer


  5. Posts : 51
    Windows 7 Home Premium 64bit
    Thread Starter
       #5

    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 Computer


  6. Posts : 6,285
    Windows 10 Pro X64
       #6

    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 Computer


  7. Posts : 51
    Windows 7 Home Premium 64bit
    Thread Starter
       #7

    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 Computer


  8. Posts : 6,285
    Windows 10 Pro X64
       #8

    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 Computer


  9. Posts : 6,285
    Windows 10 Pro X64
       #9

    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.Win7.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 Computer


  10. Posts : 3
    OS
       #10

    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 Computer


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About 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 11:47.
Find Us