Luis Diaz
asked on
Windows Batch & Powershell & VBS Script: copy files from SourceFolder which don't exist in DestinationFolder
Hello experts,
I have:
-SourceFolder and DestinationFolder
I would like to copy files located in SourceFolder which don't exist in DestinationFolder.
What is the most straightforward approach to do this?
Windows batch through robocopy & Powershell or VBS ?
Thank you for your help.
I have:
-SourceFolder and DestinationFolder
I would like to copy files located in SourceFolder which don't exist in DestinationFolder.
What is the most straightforward approach to do this?
Windows batch through robocopy & Powershell or VBS ?
Thank you for your help.
ASKER
Ok, thank you.
Possible to have .bat approach with variable declaration?
Thank you for your help.
Possible to have .bat approach with variable declaration?
Thank you for your help.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much for those proposals.
If Folders contains space should I protect them with double quotes?
If Folders contains space should I protect them with double quotes?
I always do, as in my comment. Looks like oBdA did as well.
»bp
»bp
Not when setting the variables. The quotes are added in the final command line. Just do not add a trailing backslash to the folders.
^ +1
»bp
»bp
ASKER
Noted, thank you very much for your help.
ASKER
Tested and it works!
Thank you for your help.
Thank you for your help.
Start with this (works in PS and batch):
Open in new window