diff --git a/Code/CryEngine/CrySystem/ConsoleBatchFile.cpp b/Code/CryEngine/CrySystem/ConsoleBatchFile.cpp index 7d6bc3709f..946edb9b64 100644 --- a/Code/CryEngine/CrySystem/ConsoleBatchFile.cpp +++ b/Code/CryEngine/CrySystem/ConsoleBatchFile.cpp @@ -23,27 +23,9 @@ #include #include "System.h" #include -#include IConsole* CConsoleBatchFile::m_pConsole = NULL; -namespace -{ - static void exec(const AZ::ConsoleCommandContainer& args) - { - if (args.size() == 1) - { - CConsoleBatchFile::ExecuteConfigFile(args.front().data()); - } - else - { - AZ_Warning("editor", false, "exec requires exactly one file name."); - } - } - - AZ_CONSOLEFREEFUNC(exec, AZ::ConsoleFunctorFlags::Null, "Executes a batch file of console commands."); -} - void CConsoleBatchFile::Init() { m_pConsole = gEnv->pConsole; diff --git a/Code/LauncherUnified/Launcher.cpp b/Code/LauncherUnified/Launcher.cpp index 568c202eee..1cc4450cea 100644 --- a/Code/LauncherUnified/Launcher.cpp +++ b/Code/LauncherUnified/Launcher.cpp @@ -57,8 +57,7 @@ namespace const AZStd::string& consoleCmd = commandLine->GetSwitchValue(customConCmdKey, numSwitchValues - 1); if (!consoleCmd.empty()) { - AZStd::string execString = "exec " + consoleCmd; - AZ::Interface::Get()->PerformCommand(execString.c_str()); + AZ::Interface::Get()->ExecuteConfigFile(consoleCmd.c_str()); } } } @@ -654,7 +653,7 @@ namespace O3DELauncher if (gEnv && gEnv->pConsole) { // Execute autoexec.cfg to load the initial level - AZ::Interface::Get()->PerformCommand("exec autoexec.cfg"); + AZ::Interface::Get()->ExecuteConfigFile("autoexec.cfg"); // Find out if console command file was passed // via --console_command_file=%filename% and execute it