Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,

I am trying to convert this Robo-copy script into VB.Net. Can anyone help me out?


VB
FOR %%E IN (
AAA
AAK
AAB
AAD
AAL
) DO (
robocopy "%CalSource%\esdn\data\%%E" "%CalDest%\esdn\data\%%E" /purge /e /NJH /NJS
)


I want to compare the files %calSource% datemodified with its destination file and if it is newer copy it from source and overwrite the existing. Any advice is welcome!
James
Posted
Updated 13-Oct-14 9:41am
v2
Comments
[no name] 13-Oct-14 15:34pm    
Then you should go read up on the DirectoryInfo and FileInfo classes.
Sergey Alexandrovich Kryukov 13-Oct-14 16:22pm    
Why doing that? File copying is well to simple. Anyway, you can always interpret your Robocopy script, generate code and build it. What's the problem?
But why? It would makes some sense if you created a Robocopy interpreter to copy without building any code, which could be an overkill...
—SA

1 solution

That's not a "Robocopy script" as Robotscopy doesn't have a scripting language.

That's a DOS batch file. It just happens to execute Robocopy.

It's simple really. It's just a loop that enumerates the 5 items in a list, presumably filenames, and executes Robocopy on each path specified by its command line arguments.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900