How to: Automatically move files from one location to another using Task Scheduler

preview_player
Показать описание
VBS script:

With CreateObject("Scripting.FileSystemObject")
.MoveFile "\\yourlocation\drive$\source_folder\*.*", "\\yourotherlocation\drive$\target_folder\"
End With

Note: *.* means all files and all extensions. You can tweak this to suit your needs. For example if you want to move all HTML files, change the parameter to *.html

Created with the Youtube Video Editor - all right reserved.
Рекомендации по теме
Комментарии
Автор

Is there any way to make the script only select folders after a certain date ?

Current situation is I would like to move all files within a specific folder older than 1 year over to another folder on the same network drive.

joshhobson
Автор

It's great to see videos that get straight to the point. Good Job

robret
Автор

This video is awesome. Thanks for upload. Very simple, very clear, very awesome.

erichoudek
Автор

Thanks for the upload. Really helpful. Easy to understand and implement

royhindole
Автор

Thanks for your instruction.  I need something slightly different than your example.   Here is what I want to do:  Remove everything  on my O drive once a week....regardless if read only and hidden files (or any files condition). These codes allow to delete everything, but not hidden or read only files.  If any input to this is highly appreciated.With .Deletefile "O:\Test\*.*" End With
With .DeleteFolder "O:\Test\*.*" End With

buddyle
Автор

Thank you for the instructions. Is there a way to move all the subfolders and files in those sub folders as well? ie \\target\folder1\sample.txt

AlPerreault
Автор

I'm assuming that this will work even if there are multiple files in the source folder? Excellent video by the way

Randomboy
Автор

Great video! Thak you! Which programs we may need hace installed to do this moving function? Do you have an script to also rename each file when it is moved?

villa
Автор

how to i create a command that automatically moves a file as soon as it is created? e.g. a movie from torrent. when the torrent is done the file appear in my folder. I now want to file to be copied to another folder without starting the batch file manually or wait for a scheduled time. Just copy as soon as it is created (or moved there for that sake).

lillegaard
Автор

how do you make it only move one specific file extention? like for example only move .txt files?

RockFordCademce
Автор

Great video. But the music is very disturbing and unnecessary.

fatemaalnajjar
Автор

What about files with different names? Currently I generate a new file each day with the days date as the file name, and then manually have to paste this into multiple locations. Any ideas?

butterz
Автор

Hi Bitfragment, Can you help me to auto move with overwrite from one folder to another folder ?
I just created a script and its working fine and the only thing is its not getting overwrite if same file is exist in another folder.
here is the script what i wrote :
On Error Resume Next
With
.MoveFile "D:\Folder1\*.PDF*", "D:\Folder2\" 
END WITH
I want that :
If a file with name ABC.PDF is in FolderA so it should be auto moved to Folder B with overwrite if already exist there.

mohdshezan
Автор

Hi Ravencraft,
Thanks for your video. Do we put search operation for a specific file and then move that only file. heaps of thanks if you could suggest some way.

TheRohit
Автор

Hi @bitfragment, Can you please help me? I'm looking for the script that can move first 1000 files to another directories. Thank you in advance.

jaysaherobmnr
Автор

Thank you very much !
I have a source folder of 10000 files inside and I want to synchronise only 10 to 50 files per day in the target folder. Is it possible to do this please ?

cuisinepratique
Автор

Hi, I'm from Indonesian, thank you for the instructions, really helpful, Is there a way to script a file copy based only on the current date? sorry if my english was good enough. 🙂

doriscode
Автор

Can I assume that .MoveFile can be replaced with .CopyFile if needed?

mel
Автор

Ravencraft, what happens if the source folder is empty? Is there additional logic I can add to address scenarios where the source folder is empty?

DVidinha
Автор

Hello I am getting error as below
Line: 1
Char: 57
Error: Expected statement
Code: 800A0400
Source: Microsoft VBScript compilation error

My vb code written as
With "\\sourcepath\*.*", "\\destinationpath"
End With

Can you please let me know what went wrong in code ?

srinathvulligadla