Windows batch script to move files

后端 未结 4 2169
滥情空心
滥情空心 2021-02-20 00:40

I need to move files from one directory to another in windows, and I need to write this in a batch script.

We have written a SQL job where backup files will be created e

相关标签:
4条回答
  • This is exactly how it worked for me. For some reason the above code failed.

    This one runs a check every 3 minutes for any files in there and auto moves it to the destination folder. If you need to be prompted for conflicts then change the /y to /-y

    :backup
    move /y "D:\Dropbox\Dropbox\Camera Uploads\*.*" "D:\Archive\Camera Uploads\"
    timeout 360
    goto backup
    
    0 讨论(0)
  • 2021-02-20 00:56

    You can try this:

    :backup move C:\FilesToBeBackedUp\*.* E:\BackupPlace\ timeout 36000 goto backup

    If that doesn't work try to replace "timeout" with sleep. Ik this post is over a year old, just helping anyone with the same problem.

    0 讨论(0)
  • 2021-02-20 01:05
    move c:\Sourcefoldernam\*.* e:\destinationFolder
    

    ^ This did not work for me for some reason

    But when I tried using quotation marks, it suddenly worked:

    move "c:\Sourcefoldernam\*.*" "e:\destinationFolder"
    

    I think its because my directory had spaces in one of the folders. So if it doesn't work for you, try with quotation marks!

    0 讨论(0)
  • 2021-02-20 01:06

    Create a file called MoveFiles.bat with the syntax

    move c:\Sourcefoldernam\*.* e:\destinationFolder
    

    then schedule a task to run that MoveFiles.bat every 10 hours.

    0 讨论(0)
提交回复
热议问题