Page 1 of 1

Moving Files with a .bat or SWITCH Script?

Posted: Fri Nov 02, 2018 8:26 pm
by matt.baile
I'm working on two flows in SWITCH that involve moving incoming zip archives and xml files to a location on our network. The files are then picked up by a service running on another internal server, and they are eventually processed into a proprietary system in-house. The problem that I'm having is that the service picking up these files is not playing nicely with the SWITCH transfer and the service gets hung up. What I'd like to do is to move files with a .bat file using an execute command element or use a SWITCH Script to do the move.

Ideally, I'd just like to have an incoming job hit the execute comman or script element and say "move incoming job to \\network\folder" or have the file placed somewhere on the network and then a trigger that says "move job at \\network\folderA to \\network\folderB"

Either way, the file needs to be written by a comman or script so that SWITCH isn't doing the folder to folder transfer. Any suggestions on the best way to do that?

Re: Moving Files with a .bat or SWITCH Script?

Posted: Fri Nov 02, 2018 10:13 pm
by matt.baile
I did find this post from a few years ago:

viewtopic.php?f=13&t=1164&p=4274&hilit=move+file#p4274

Unfortunately, this doesn't work and is giving me an error of:Requested property is not defined: 'destDir'; trying to use default value

Re: Moving Files with a .bat or SWITCH Script?

Posted: Sun Nov 04, 2018 5:30 pm
by Padawan
There are some issues possible, but most of them can be fixed by disabling safe move in the Switch folder element. Did you try this already?

If you want to use the script you will have to add a property to the script, name it 'destDir' and setup your location in that property.

Re: Moving Files with a .bat or SWITCH Script?

Posted: Sun Nov 04, 2018 5:37 pm
by jan_suhr
Isn't the problem on the receiving end that it catches the files before Switch is done copying them over to that server?

Re: Moving Files with a .bat or SWITCH Script?

Posted: Mon Nov 05, 2018 3:07 pm
by matt.baile
I suppose the problem is technically on the receiving end with the service catching the file before it's done writing. I've asked our development team working on this service to address the issue, but I was hoping to do something in SWITCH to help if possible. I saw Dwight's script and thought I should try something similar. In the meantime, I'll disable safe move on the folder and see if that helps.
-Matt

Re: Moving Files with a .bat or SWITCH Script?

Posted: Tue Nov 06, 2018 5:02 pm
by matt.baile
I wanted to confirm that disabling the Safe Move did solve the problem, at least for now. After hanging up on nearly every file, or every other at best, the system processed 49 files last evening with no problems. Hopefully this has resolved things permanently. As always, thanks for the input!