PB.INI is a text file that contains variables that specify your PowerBuilder preferences. These preferences include information such as the last workspace you used and your startup preferences. When you perform certain actions in PowerBuilder, PowerBuilder writes your preferences to PB.INI automatically.
Format of INI files
PB.INI uses the Windows INI file format. It has three types of elements:
-
Section names, which are enclosed in square brackets
-
Keywords, which are the names of preference settings
-
Values, which are numeric or text strings, assigned as the value of the associated keyword
A variable can be listed with no value specified, in which case the default is used.
Some sections are always present by default, but others are created only when you specify different preferences. If you specify preferences for another painter or tool, PowerBuilder creates a new section for it at the end of the file.
Specifying preferences
Normally, you do not need to edit PB.INI. You can specify all your preferences by taking an action, such as resizing a window or opening a new application, or by selecting Design>Options from one of the painters. If a variable does not appear by default in the options sheet for the painter, you can use a text editor to modify the variable in the appropriate section of PB.INI.
The PB.INI file also enables you to take advantage of some features or avoid issues in certain circumstances. For a complete list of the INI entries and how to modify them, see PB.INI settings.
Editing the initialization file
Do not use a text editor to edit PB.INI or any preferences file accessed by Profile functions while PowerBuilder or your application is running. PowerBuilder caches the contents of initialization files in memory and overwrites your edited PB.INI when it exits, ignoring changes.
Where the initialization file is kept
PB.INI is installed in the same directory as the PowerBuilder executable file, but is copied to the C:\Users\[username]\AppData\Local\Appeon\PowerBuilder [version] for each PowerBuilder user the first time the user opens PowerBuilder. PowerBuilder subsequently uses the PB.INI copy each time the same user starts an instance of PowerBuilder IDE.
Telling PowerBuilder where your initialization file is
You can keep PB.INI in another location and tell PowerBuilder where to find it by specifying the location in the System Options dialog box. You may want to do this if you use more than one version of PowerBuilder or if you are running PowerBuilder over a network.
To record your initialization path
-
Select Tools>System Options from the menu bar.
-
On the General tab page, enter the path of your initialization file in the Initialization Path text box.
PowerBuilder records the path in the Windows registry.
How PowerBuilder finds the initialization file
PowerBuilder looks in the Windows Registry for a path to the initialization file, and then looks for the file in the directory where PowerBuilder is installed. If PowerBuilder cannot find PB.INI using the path in the Registry, it clears the path value.
Now that multiple PowerBuilder IDEs can be installed on the same machine, and one PowerBuilder IDE can work with multiple versions of PowerBuilder Runtime on the same machine. If PowerBuilder IDE and PowerBuilder Runtime are of the different major versions, for example, IDE 2021 works with Runtime 2019 R3, then IDE will look for PB.INI in the following way:
PB.INI used by IDE at first startup |
Initialization Path for each user |
||
---|---|---|---|
When IDE 2021 works with Runtime 2019 R3 |
If IDE 2019 R3 is also installed |
First search in the 2021 installation path, for example, C:\Program Files (x86)\Appeon\PowerBuilder 21.0\pb.ini. If not found, then search in the path recorded in the Windows registry corresponding to the runtime version, for example, C:\Users\[username]\AppData\Local\Appeon\PowerBuilder 19.0\pb.ini |
The default initialization path is determined by the current IDE, for example, C:\Users\[username]\AppData\Local\Appeon\PowerBuilder 21.0\pb.ini |
If IDE 2019 R3 is NOT installed |
Search in the 2021 installation path, for example, C:\Program Files (x86)\Appeon\PowerBuilder 21.0\pb.ini. PB.INI will be recreated automatically with the default settings in the 2021 installation path if it is renamed or deleted. |
If the initialization file is missing
If PowerBuilder does not find PB.INI when it starts up, it recreates it. However, if you want to retain any preferences you have set, such as database profiles, keep a backup copy of PB.INI. The recreated file has only the default preferences.