Help / Tools / WDOptimizer
  • Syntax
  • The following syntax enables you to start WDOptimizer in command line
  • Examples
  • Example of reindex procedure
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures

The following syntax enables you to start WDOptimizer in command line

WDOptimizer /Fic=<Directory>
/Option=<Type of action performed>
/Log=<Log file>
/Charset=<Character set>
/Density=<Density rate>
/Language=<Display language>
The table below presents the different elements that can be found on the command line:
/Fic=<Directory>To process a single data file: full path of the data file to process.
To process a set of data files:
  • path of a directory,
  • INI file in export format generated by WDOptimizer.
To process the transactions: full path of the transaction file.
Example: c:\temp\file.fic
/Pwd=<Password>Password associated with the data file to process (single data file)
/Option=<Type of action to perform>Number corresponding to the option of WDOptimizer to start:
1: Check the index.
2: Optimize the speed of indexes (recalculate the statistics on the data files).
3: Rebuild indices.
4: Rebuild indexes and memos.
5: Check and compress the indexes and the memos.
/Log=<Log file>Full path of the log file (.log) to create. This file is created only if an option from 1 to 5 is selected.
/Mute=<Yes/No>Yes to automatically validate the report window (No by default).
/ExploreSubDir=<Yes/No>Yes to explore subdirectories of the directory specified in the "/Fic" parameter (No by default).
/CompressIndex=<Yes/No>Yes to delete inactive records when reindexing (options 3 and 4) (No by default).
/DelIndex=<Yes/No>Yes to delete the damaged records (options 3 and 4) (No by default).
/GetMemos=<Yes/No>Yes to try to retrieve the data from the memo if it is damaged (option 5) (No by default).
/KeepCrossedRec=<Yes/No>Yes to keep the crossed records (option 5) (No by default).
/Charset=<Charset>Used to specify the character set used for the reindexing operation. You have the ability to use one of the constants corresponding to the character set to use.
charsetArabicArabic characters
charsetBalticBaltic characters
charsetChineseChinese characters (People's Republic of China)
charsetDefaultUses the computer's default character set. No character set is forced.
charsetEastEuropeCharacters of Eastern Europe (Polish, ...)
charsetGreekGreek characters
charsetHebrewHebrew characters
charsetJapaneseJapanese characters
charsetKoreanKorean characters
charsetOccidentalRoman characters in ANSI standard
charsetRussianRussian characters
charsetThaiThai characters
charsetTraditionalChineseTraditional Chinese characters (Republic of Taiwan)
charsetTurkishTurkish characters
charsetUTF8Used to manage the countries with two character sets (Hong Kong) and the countries with no character set defined in Windows (Georgian and Armenian).
charsetVietnameseVietnamese characters
/Density=<Density rate>Density rate of indices. This rate is set to 80 by default.
The higher this rate is, the denser and smaller the index is. In this case, iterations, searches, filters and queries will be faster. The additions of records and the modifications of records may be slower.
The lower this rate is, the less dense and the bigger the index will be. In this case, iterations, searches, filters and queries will be slower. The additions of records and the modifications of records will be faster.
/Language=<Display language>"US" to start WDOptimizer in English (French by default).
/Bck=<No>By default, the files to process are saved (only taken into account if /option = 5). No if you don't want to perform this backup.
The command line below is used to reindex the files found in "C:\MyApp\Data".
ExeRun("C:\MyDirectory\WDOptimizer.EXE /Fic=C:\MyApp\Data")
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)

Example of reindex procedure

// Global variables of the project 
gsAppName is string = "MyApp"
gsDataDir is string = CompleteDir(fExeDir()) + "Data\"
//Procedure global to the project 
PROCÉDURE gWdOptimizeAnalysis(_OptionNum = 5,_bSave = False)
// Control WDOPTIMIZER for all the files of an application 
// while taking into account the password, exeActive and 
// WDOptimizer is blocking when run. 
// After each reindex operation, WDOptimizer displays the message
// "The  'C:\ ...\MyFile.Fic' file was successfully reindexed".
// The user must click "OK".
// The option 5 of WDOptimizer is used by default
// By default, the files are not saved before optimization
// - Required: 
//   - The data files can be relocated in relation to the exe 
// (Global variables gsAppName and gsDataDir)
//  - WDOptimizer is always found beside the executable
//  - The files can have a physical name that differs from the logical name 
// as well as an extension <> ".FIC"

// Variables local to the process
sFileList, sFileName are strings
sSave is string = "False"
IF _bSave = True THEN sSave = "True"
i is int = 1
sDir is string = CompleteDir(fExeDir())
// Physical name of the file (name + extension)
sPhysicalFileName is string
// Password of the file 
sPwd is string 
sCommandLine is string

// Check for WDOptimizer
IF fDir(sDir + "WDOptimizer.EXE", frFile) = "" _OR_ ...
fDir(sDir + "WDTool.WDK", frFile) = "" THEN 
Error("WDOptimizer has not been correctly installed")

// List the analysis files
sFileList = HListFile()
sFileName = ExtractString(sFileList, i, CR)
WHILE sFileName <> EOT 
sPhysicalFileName = {sFileName}..PhysicalName + {sFileName}..Extension
IF fDir(gsDataDir + sPhysicalFileName, frFile) <> "" THEN 
// Take the passwords of some protected files into account  
SWITCH Upper(sFileName)
CASE "TOTO": sPwd = "toto"
OTHER CASE: sPwd = ""  
IF sPwd <> "" THEN 
sCommandLine = 
sDir + "WDOptimizer.EXE   /File=" + ...
gsDataDir + sPhysicalFileName + " /Pwd=" + sPwd + " /" + ...
_OptionNum + " /" + sBackup
sCommandLine = sDir + "WDOptimizer.EXE   /File=" + ...
gsDataDir + sPhysicalFileName + " /5 /" + sBackup
ExeRun(sCommandLine, exeActive, exeWait)
sFileName = ExtractString(sFileList, i, CR)
Info("The files found in '" + gsAppName + "' were successfully optimized")
Minimum version required
  • Version 9
This page is also available for…
Click [Add] to post a comment

Last update: 09/14/2023

Send a report | Local help