xcopy Error 4 definition below
Initialization error occurred. There is not enough memory or disk space, or you entered an invalid drive name or invalid syntax on the command line.
From the documentation here.
I think the most likely cause is that the external location is not accessible to the script when it is run by FileMaker Server. You may need to add a "net use" command to your batch file. See here for the syntax for that. You can use it for network locations and external drives.
A second possibility is a permissions error. Make sure the account you enter in the FileMaker Server Admin Console schedule assistant has permissions to copy to the location specified in the batch file. The default is Local System, but you may need to change this to an account that has permission to copy to the external location. See below for the schedule assistant where you can specify the account.
The drive I'm copying to is a network drive on a server which is attached to the domain - our FileMaker Server is in a DMZ connected to the LAN though.
Would the netuse command be used in conjunction with the xcopy - basically to enable the network drive to work in the first place, I needed to enter domain\username and password for the network drive, it now works when I run the batch script manually just not through the admin console, I've tried to specify different user settings by using the current logged on user's info (me) but that then said script missing.
I suggest that you look at using Robocopy instead for a more robust solution. It just might fix your permissions issue too
This is the most basic way to use it top copy a directory with logging, mirroring to the destination /MIR, and with resume if network connectivity is lost /Z
Robocopy "E:\ExampleSourceDirectory" "\\ExternalServer\ExampleDirectory" /MIR /Z /log:"E:\log.txt"
1 of 1 people found this helpful
You need a net use line in your batch file before the xcopy line. I believe the format should be:
net use \\external_location\reporting password /USER:username
xcopy /s /y "C:\Program Files\FileMaker\FileMaker Server\Data\Documents" \\external_location\reporting