how to write value in SqlConfiguration.ini file using java api like "C:\Program Files\Microsoft SQL Server"?

StackOverflow https://stackoverflow.com/questions/21794432

  •  12-10-2022
  •  | 
  •  

Question

Current Output:

[SqlServer2008]

INSTALLSHAREDDIR = C:\Program Files\Microsoft SQL Server

Required Output:

INSTALLSHAREDDIR = "C:\Program Files\Microsoft SQL Server"

Java code:

Uesin org.ini4j api..............
String installDoc ="F:\\SQLExpressConfigurationFile_x64.ini";
Wini ini;
File file = new File(installDoc);
    try {
    ini = new Wini(file);
ini.put("SQLSERVER2008", "INSTALLSHAREDDIR", "C:\Program Files\\Microsoft SQL Server");
ini.store();

Please let me know how to get required output with ini4j api or other api. Thanks in advance

No correct solution

OTHER TIPS

Use backslashes to escape the double quotes like this:

"\"C:\Program Files\\Microsoft SQL Server\""
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top