Hi Prasad Bhonsule
Run this to see what happens.
cmd.exe /K "C:\Windows\System32\robocopy.exe %FilePath% D:\PDFs\ %FileName%"
If xcopy is an option, try using this.
cmd.exe /C "C:\Windows\System32\xcopy.exe /Y %FilePath% D:\PDFs\%FileName%*"
I hope it helps.
You might also try putting the filepath and destination path in quotes, since it's possible your filepath contains spaces.
Don't use robocopy for single files, it's meant for directories. The syntax for robocopy is
robocopy sourcedir destdir filename so you'd need something like this
But that doesn't work since Folderpath is something like \Test\ instead of C:\Vault\Test. You can validate in ProcessMonitor:
So if you change the command to xcopy "sourcefilepath" "destfilepath" /Y then it should work great. (Don't put the filename in the dest or it will prompt you to verify if the name is a file or directory, /Y overwrites without prompt)
Thanks everyone, finally got it working with Charley's suggestions as above.
I had a similar need and the correct answer was very helpful however the PDM user that will initiate this transition doesn't have access to the file share outside of the PDM vault where I wanted the file copied. I used the below 3 "Execute command" steps in my transition to pull this off. The only downside I've found is that 3 CMD windows pop up for less than a second.
net use Z: "\\XX.XX.XX.XXX\QMS Docs\" /user:PDMUSER@MYDOMAIN PDMUSERPASSWORD /persistent:no
(PDMUSER is a special user that has write access only to this "QMS Documentation" folder and the password is set to not expire in AD)
"C:\Windows\System32\xcopy.exe" "%FilePath%" "Z:" /y /q
net use Z: /delete /y
It's important to have "Wait until the started program terminates." checked for all three transitions.
I hope this helps someone else in the future.