Run Anaplan Connect from Network Drive

(Solution provided by Ben Speight) In order to run Anaplan Connect from a network drive, an adjustment needs to be made to file 'example.sh' or 'example.bat' in the Anaplan Connect 'examples' folder. (Note: The example.sh or .bat file should first be copied into the main Anaplan Connect folder, and then adjusted using the steps below.) Step 1: Replace the line: "cd %~dp0" with: "pushd %~dp0" Step 2: Before the "pause" line, insert: "popd" This should get it to work, although you'll still get an error message about UNC paths. To remove this, create a shortcut to the batch file in the same directory by right clicking on it and selecting "Create shortcut", edit the shortcut's properties and set the "Start in:" field to something that is a local directory on every machine that it will be run from - "%USERPROFILE%" worked for me by substituting the user's profile folder, although it shouldn't really matter where as the script will leave it for the network folder before doing anything. When given a UNC path (\\computer\share\...) the pushd will map the share to a drive, typically Z: or the last unmapped drive letter. The popd will unmap the drive and return to the original location. The reason this is mentioned is because if the close button on the command window is pressed before the program completes, the drive will be left mapped. Original examples.sh script: ---------------------------------------------------------------------------------------------------------------- @echo off rem This example loads a source text file and runs an Anaplan import into a module. rem For details of how to configure this script see doc\Anaplan Connect User Guide.doc   set AnaplanUser="user@company.com" set WorkspaceId="Workspace Name" set ModelId="Model Name" set Operation=-file "gm3.txt" -put "C:\Users\user\Desktop\gm3.txt" -import "Gross Margin from gm3.txt" -execute -output "C:\My Errors.txt" rem *** End of settings - Do not edit below this line *** setlocal enableextensions enabledelayedexpansion || exit /b 1 cd %~dp0 if not %AnaplanUser% == "" set Credentials=-user %AnaplanUser% set Command=.\AnaplanClient.bat %Credentials% -workspace %WorkspaceId% -model %ModelId% %Operation% @echo %Command% cmd /c %Command% pause

Answers