We help IT Professionals succeed at work.

SAP Business One on Server 2008 R2 with roaming profiles?

Medium Priority
Last Modified: 2012-05-12
Does anyone use SAP Business One with roaming profiles?  I am stuck in an issue where SAP is storing critical user files in the local and locallow appdata folders, which are not included in the roaming profile.  What about a script to copy these files to the roaming profile at user log off?  

Any advice would be greatly appreciated.  Thanks!
Watch Question


I'm assuming the SAPLOGN.ini file?

We're using SAP Gui with Business Explorer and came across the same thing, our SAP Admin sent me the following PDF which fixes the problem:
Below is the Script referred to in the pdf.

You basically just setup a machine SAPLOGON_INI_FILE environment variable pointing to what ever location you want the ini file to be found.

Hope that helps.

strIniFile = NwEngine.Variables.ResolveString("%USERPROFILE%\AppData\Local\VirtualStore\Windows\saplogon.ini")
strCmdLine = "setx /M SAPLOGON_INI_FILE " & strIniFile
bNoWaiting = vbFalse
NwEngine.Shell.Execute strCmdLine, bNoWaiting

Open in new window


I'm not sure if this is the same.  Our users are working in the SAP B1 client on 2008 R2 terminal servers.  I was not able to locate the SAPLOGN.ini at C:\Windows.  The files that seem to be causing the issues for us are located at the following path; also listed are the names of the files themselves.

C:\Users\{UserProfile}\AppData\Local\SAP\SAP Business One\


If these files are present in the user profile the user settings are remembered during SAP login.  If they are not present the user is forced to go through the initial process where they must choose a company, etc.
Andrew OakeleyConsultant

If it
a) just those two files
b) there is no way of changing SAP B1 to make it look for them somewhere else

why don't you just create a script that copys them to somewhere else in their profile and back again when the user logs off and on.

eg on logoff
copy %userprofile%\AppData\Local\SAP\SAP Business One\b1-conf.dtd %userprofile%\documents\
copy %userprofile%\AppData\Local\SAP\SAP Business One\b1-current-user.xml %userprofile%\documents\

on logon do the reverse

Seriously nasty and clunky as hell..... but it will more than likely work.


Thanks, aoakeley.  That's what I am doing now, minus the logon script part.  I am running a user logoff script that copies these files directly into the users roaming profile on the network share.  When the user logs in again these files are loaded back to the server with the roaming profile.  Problem solved...or so I thought.  If the user does not launch SAP, in turn these files are not modified and the logoff script is not only not copying the files back to the roaming profile share, it is actually deleting the folder altogether.  Here is the script:

robocopy "%userprofile%\AppData\Local\SAP\SAP Business One" "\\{my server}\TSProfiles\%username%.{my domain}.v2\AppData\Local\SAP\SAP Business One" /s /LOG+:INFO

I want the script to copy the files to the destination and overwrite if they have been modified, but I surely don't want them deleted at the destination if they are not modified.  Like I said earlier, this script works perfectly as long as the files are accessed and/or modified.  Am I using the wrong switch or missing a switch somewhere?
I think where your method is falling over is that you are trying to create a "local" folder within the roaming profile. Try just copying the files in and out of the users "documents" folder instead. Either copy, xcopy, robocopy will be fine. If they are copied in at login, then even if sap is not used in that session copy out is just going to rotate the identical files.


Thanks!  Creating a reverse logon script solved the file deletion.