in my script I need to copy a file to a specific folder. What do I need to enter in "Send event"? (Only for Windows, Mac is already working).
Thanks for your help
Give the following a try:
cmd /c copy sourcefile destinationfolder
cmd /c copy P:\Test.txt P:\Test
Should copy the Test.txt file from the P: directory into the P:\Test directory.
I use a container field and export the file to a calculated file path, and it works great, it also let's you rename the file to whatever you want, using a variable.
But I have also executed "open" and "delete" commands via the send event script step.
Here is the text of the calcuation in this example.
"cmd /c del \""&Files_shipments::WindowsFileFullPath_OpenFile&"\""
Hope this helps.
thanks it works.
But now I have a second problem: I want that the file is only copied if there is no file with this name.
I saw that the file is overriden every time I execute the script.
Do you know a solution for this too?
Try using robocopy instead of copy with the following switches:
cmd /c robocopy sourcefile destinationfolder /XC /XN /XO
robocopy doesn't work.
Sorry the syntax is actually a little different for robocopy!
Try the following:
cmd /c robocopy sourcefolder destinationfolder sourcefile /XC /XN /XO
Using my example from above it would be
cmd /c robocopy P:\ P:\Test Test.txt /XC /XN /XO
If that still doesn't work can you please confirm what version of Windows you are running?
Thank you! Now it works without overwriting!
Have a nice day/evening.
Retrieving data ...