Change PI DataLink settings for all users on a computer
- Last UpdatedMar 19, 2025
- 2 minute read
- PI System
- PI DataLink 2023 SP1
- Visualization
Administrators can use a batch file to change the PI DataLink settings for all users on a computer.
-
Create the OSIsoft.PIDataLink.xml file that contains the preferred settings for all users.
You might copy the file from a user account folder (%UserProfile%\AppData\Local\OSIsoft,_Inc\PIDataLink), or you can create one starting with the following default file:
<Settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CTPDockWidth>200</CTPDockWidth>
<CTPFloatLeft>-1</CTPFloatLeft>
<CTPFloatTop>-1</CTPFloatTop>
<CTPFloatWidth>200</CTPFloatWidth>
<CTPFloatHeight>-1</CTPFloatHeight>
<CTPDockPosition>right</CTPDockPosition>
<CopyItemsInRow>0</CopyItemsInRow>
<CopyServerName>0</CopyServerName>
<UseServerTime>0</UseServerTime>
<DisplayEndTime>0</DisplayEndTime>
<DisplayNA>0</DisplayNA>
<LocaleIndependent>0</LocaleIndependent>
<DisableAutoReinit>0</DisableAutoReinit>
<DisableResizeMessage>0</DisableResizeMessage>
<NFormat>General</NFormat>
<TFormat>dd-mmm-yy hh:mm:ss</TFormat>
<AutoUpdateCalculateMode>0</AutoUpdateCalculateMode>
<AutoUpdateInterval>0</AutoUpdateInterval>
<LastSearchFullPath>false</LastSearchFullPath>
<LastSearchPath> </LastSearchPath>
<LastEFDatabase> </LastEFDatabase>
<MaxEFCount>1000</MaxEFCount>
<MaxAFSearchCount>10000</MaxAFSearchCount></Settings>
-
Create a batch file to distribute the preferred settings file to all users.
For example, you might create a batch file called deploySettings.bat:
@echo off
IF NOT EXIST "%CD%\OSIsoft.PIDataLink.xml" (
ECHO OSIsoft.PIDataLink.xml file not found in this directory.
EXIT /B 2
)
SET ProfileBase=%SystemDrive%\Users
SET AppDir=APPDATA\Local
SET DefaultUsername=Default
ECHO Deploying XML settings to all users.
for /f "tokens=*" %%a in ('dir /b /ad-h "%ProfileBase%"') do if 1==1 (
REM No need to copy to Public and All Users folders
ECHO %%a | findstr /i "all.users public" >nul 2> nul
if errorlevel 1 (
mkdir "%ProfileBase%\%%a\%AppDir%\OSIsoft,_Inc"
mkdir "%ProfileBase%\%%a\%AppDir%\OSIsoft,_Inc\PIDataLink"
xcopy /f /y "%CD%\OSIsoft.PIDataLink.xml" "%ProfileBase%\%%a\%AppDir%\OSIsoft,_Inc\PIDataLink\"
)
)
REM Apply to default user
mkdir "%ProfileBase%\%DefaultUsername%\%AppDir%\OSIsoft,_Inc"
mkdir "%ProfileBase%\%DefaultUsername%\%AppDir%\OSIsoft,_Inc\PIDataLink"
xcopy /f /y "%CD%\OSIsoft.PIDataLink.xml" "%ProfileBase%\%DefaultUsername%\%AppDir%\OSIsoft,_Inc\PIDataLink\" -
Save the batch file in the same directory as the OSIsoft.PIDataLink.xml file that contains the preferred settings.
-
From Windows Explorer, right-click the batch file and then select Run as administrator.
The script irreversibly overwrites any existing settings for all users on this computer and replaces the settings with the preferred settings. New users on this computer will have the same settings.
-
If you do not want new accounts (created after running this script) to have these preferred settings, remove the OSIsoft.PIDataLink.xml file from the Default user account (found in C:\Users\Default\AppData\Local\OSIsoft,_Inc\PIDataLink).