Unreal Insights CLI: How to export to folders with spaces in path?

I’m trying to export a .utrace with UE Insights via command line. The export works if the output path has no spaces, but fails if the folder name contains spaces.

Example (works):

"C:\Epic Games\UE_5.6\Engine\Binaries\Win64\UnrealInsights.exe" 
  -OpenTraceFile="C:\dev\Unreal\CitySample\Test.utrace" 
  -NoUI -log -AutoQuit 
  -ExecOnAnalysisCompleteCmd="TimingInsights.ExportThreads C:\dev\Unreal\CitySample\My_CSV\ExportThreads.csv"

Example (fails because of space in folder name):

"C:\Epic Games\UE_5.6\Engine\Binaries\Win64\UnrealInsights.exe" 
  -OpenTraceFile="C:\dev\Unreal\CitySample\Test.utrace" 
  -NoUI -log -AutoQuit 
  -ExecOnAnalysisCompleteCmd="TimingInsights.ExportThreads C:\dev\Unreal\CitySample\My CSV\ExportThreads.csv"

It looks like I can’t wrap the path in quotes because ExecOnAnalysisCompleteCmd is already wrapped in quotes, which causes a conflict.

Is there a way to export to folders with spaces in their path using Unreal Insights CLI?

To be able to use spaces in exporting paths, you can use a response file. Example:

Write the export script in a export.rsp text file like:

TimingInsights.ExportThreads "D:/Tests/Folder with Spaces/ExportThreads.csv"
TimingInsights.ExportTimingEvents "D:/Tests/Folder with Spaces/TimingEvents – [{region}].csv" -threads="GameThread" -timers="*" -region="Editor.*"

And run UnrealInsights with

UnrealInsights.exe
    -OpenTraceFile="C:\dev\Unreal\CitySample\Test.utrace"
    -NoUI -log -AutoQuit
    -ExecOnAnalysisCompleteCmd="@=%cd%\Folder with Spaces\export.rsp"
1 Like

It works, many thanks !