![]() |
VBScript to copy file from 1 path to another path
Dear all,
I want to copy files from a folder. Basically i i want to copy files if the folder exist. If it does not exist then check another folder. I have 3 folders to look at. The folder name is in date format yymmdd. But i just want to look at for 1st, 2nd or 3rd day of the month only. Basically the flow is like this but i don't know how to create a complete vbscript. If folder yymm01 exist at path: \\servername\sample\ then copy files in it to \\servername\prod\ then exit. else check if folder yymm02 exist at path: \\servername\sample\ then copy files in it to \\servername\prod\ then exit. else check if folder yymm03 exist at path: \\servername\sample\ then copy files in it to \\servername\prod\ then exit. Thanks in advance for any help. |
Re: VBScript to copy file from 1 path to another path
Maybe you can try using CopyFile function. So something like this My.Computer.FileSystem.CopyFile(sourceFileName ,destinationFileName)
Im not VB expert, but I hope you will find some more on google :) |
Re: VBScript to copy file from 1 path to another path
Dear all,
I manage to create the script to copy the files but i got error: Object required:" at the highlighted line, char 6. Does anyone know what is wrong with my script? Code:
|
| All times are GMT +5.5. The time now is 11:13. |