Hello and welcome to my channel where I will be posting IT related videos and training courses. Please leave any suggestions for a future video you might want to see.
I was using a service called MultCloud to move files around on a schedule and it fails almost daily. You just saved me the expense of a third party app, but more importantly something that will just work. Thank you!!!
You replace * .* with *.txt, like this: With CreateObject("Scripting.FileSystemObject") .MoveFile "\\source\drive$\source_folder\*.txt", "\\destination\drive$\target_folder\" End With
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. 🙂
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.
Hello Josh, Not with the VBScript in this video but you could easily do it with Powershell. Something like this should work: Get-Childitem -Path "d:\source_folder" -Force | ?{$_.LastWriteTime -lt (Get-Date).AddDays(-365)} | Move-Item -Destination "e:\destination_folder" -Force This can be saved as a .ps1 file which in turn can be referenced via a Scheduled Task that can be run once every few months depending on your need. Give it a run and let me know if there are any issues. Cheers!
hello programer i have a some problem about programing i have 0 knowldege about programing but i want to make a programe i have many employee folder like this 09140. 09141. 09142.09143... and i have many document like this 09142.pdf 09142.jpg 09143.jpg ..i want to make a program file auto move in same name of folder if u have a code i want just copy here and past in powershell and program work for me and please also mention the where i can put source path and destination path .
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?
Did you try rebuilding the boot sectors? From CMD in the troubleshooting/diagnostics screen after a failed boot run the following commands in this specific order: bootrec /FixMbr bootrec /FixBoot bootrec /ScanOs bootrec /RebuildBcd And then reboot the server.
@@bitfragment no i was try to recover data first, now i want to rebuild structure as standard like c will be windows and d will be data drive i need help
Instead of .MoveFile you declare .CopyFile, like this: With CreateObject("Scripting.FileSystemObject") .CopyFile "\\yourlocation\drive$\source_folder\*.*", "\\yourotherlocation\drive$\target_folder\" End With
Thanks So Much! I had this issue while setting up a VM lab with three servers and one client and after googling the error, you video just popped up... Thanks a lot!
Thanks for video. I have a question let say i have 10 folder and i want move it with different times. ex. folder 1 i want move it where file more than 1 year. folder 2 more than 2 years . 3-10 thanks
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 ?
Hi Thanks for the video. I have a scenario, my source file is in one server and I need to write a VBA script to move the file to another server for which I know the user name and password.so, how can I write a script including username and password in it?
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 CreateObject("Scripting.FileSystemObject") .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.
Hi Mohd, Unfortunately, the VBScript MoveFile method works only when the target file does not exist. This is very limited and I do not encourage you to use it, this video was more to show how to use something different than what you would do normally, to get the job done. I would encourage you to try powershell instead. Create a powershell script with this command and run it with the scheduled task instead of the VBScript: Move-Item -Path \\10.10.10.10\c$\test\*.* -Destination \\10.20.20.20\c$\test2\ -Force Replace the -Path IP address with your SOURCE server and -Destination with your destination server. Using the -Force switch at the end will overwrite files if they already exist. Hope this helps! Vlad