diff --git a/es-app/src/FileData.cpp b/es-app/src/FileData.cpp index 8e9574c5e..0cd8b5e25 100644 --- a/es-app/src/FileData.cpp +++ b/es-app/src/FileData.cpp @@ -1944,7 +1944,10 @@ void FileData::launchGame() #if defined(_WIN64) // Hack to remove double quotation marks as these can occur under some special circumstances. - command = Utils::String::replace(command, "\"\"", "\""); + const int quotationCount {static_cast( + std::count_if(command.cbegin(), command.cend(), [](char c) { return c == '\"'; }))}; + if (quotationCount % 2 != 0) + command = Utils::String::replace(command, "\"\"", "\""); command = Utils::String::replace( command, "%ESPATH%", Utils::String::replace(Utils::FileSystem::getExePath(), "/", "\\"));