Hello @void and thank you for your reply!
In both instances I am refering to using the "-folders" parameter via the command line(powershell) and not directly editing the main .ini file.
(all code below is in Powershell)
To replicate for the list syntax:
Code: Select all
$foldersArray = "c:\first path; with semicolon, and colon", "c:\second path"
$foldersString = "`"$($foldersArray -join '`";`"')`""
echo "SEARCH STRING IS: $foldersString"
./Everything64.exe -folders "$foldersString"
Troubleshooting info reports:
Code: Select all
Command line: -folders "c:\first path; with semicolon, and colon";"c:\second path"
Resulting .ini file contains:
Code: Select all
folders=and colon,c:\first path,c:\second path,with semicolon
To replicate for the "JSON-like" syntax:
Code: Select all
$foldersArray = "c:\first path {with curly brackets}", "c:\second path"
$folders = @()
foreach ($path in $foldersArray) {
$folders += [ordered]@{
"path" = "$path"
"subfolders" = 1
}
}
$encodedFolders = ($folders | ConvertTo-Json -Compress).Replace('\\','\')
echo "ENCODED FOLDERS JSON IS: $encodedFolders"
./Everything64.exe -folders "$encodedFolders"
Troubleshooting info reports:
Code: Select all
Command line: -folders [{"path":"c:\first path {with curly brackets}","subfolders":1},{"path":"c:\second path","subfolders":1}]
Resulting .ini file contains:
Code: Select all
folders=c:\first path {with curly brackets,c:\second path,subfolders:1}
Regarding the JSON-decode that Everyhting is doing(possibly unrelated to the above issues):
If we remove the problematic charactes from the paths(for simplicity) and remove ".Replace('\\','\')", so we have properly escaped JSON
Code: Select all
$foldersArray = "c:\first path", "c:\second path"
$folders = @()
foreach ($path in $foldersArray) {
$folders += [ordered]@{
"path" = "$path"
"subfolders" = 1
}
}
$encodedFolders = ($folders | ConvertTo-Json -Compress)
echo "ENCODED FOLDERS JSON IS: $encodedFolders"
./Everything64.exe -folders "$encodedFolders"
Troubleshooting info reports:
Code: Select all
Command line: -folders [{"path":"c:\\first path","subfolders":1},{"path":"c:\\second path","subfolders":1}]
Resulting .ini file contains:
Code: Select all
folders=c:\\first path,c:\\second path
Seems like "\\" is not getting properly unescaped. This is what led me to believe that Everything is not doing a proper JSON decode, as that should include unescaping, correct?