Moving Files with a .bat or SWITCH Script?

Post Reply
matt.baile
Member
Posts: 43
Joined: Wed Nov 29, 2017 4:36 pm

Moving Files with a .bat or SWITCH Script?

Post 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?
matt.baile
Member
Posts: 43
Joined: Wed Nov 29, 2017 4:36 pm

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

Post 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
Padawan
Advanced member
Posts: 358
Joined: Mon Jun 12, 2017 8:48 pm
Location: Belgium
Contact:

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

Post 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.
jan_suhr
Advanced member
Posts: 592
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

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

Post 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?
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
matt.baile
Member
Posts: 43
Joined: Wed Nov 29, 2017 4:36 pm

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

Post 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
matt.baile
Member
Posts: 43
Joined: Wed Nov 29, 2017 4:36 pm

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

Post 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!
Post Reply