2

I have a batch file as follows to clean my UE project.

del *.sln
rmdir /s /q .vs
rmdir /s /q Binaries
rmdir /s /q Intermediate
rmdir /s /q Saved
rmdir /s /q DerivedDataCache
"C:\Program Files (x86)\Epic Games\Launcher\Engine\Binaries\Win64\UnrealVersionSelector.exe" /projectfiles Attaching.uproject

Unfortunately, when I run the batch, I get an error as follows:

enter image description here

I found the last command in the batch by reverse-engineering as shown below:

enter image description here

enter image description here

enter image description here

Question

What is the correct way to generate Visual Studio project files from a batch file?

Second Person Shooter
  • 14,188
  • 21
  • 90
  • 165

1 Answers1

3

After wasting a lot of time, I found the solution. We have to fully qualify the project path.

echo off

del *.sln
rmdir /s /q .vs
rmdir /s /q Binaries
rmdir /s /q Intermediate
rem rmdir /s /q Saved
rmdir /s /q DerivedDataCache


set MyUVS="C:\Program Files (x86)\Epic Games\Launcher\Engine\Binaries\Win64\UnrealVersionSelector.exe"
set MyUBT="f:\Program Files\Epic Games\UE_4.26\Engine\Binaries\DotNET\UnrealBuildTool.exe"

rem change Transformation to your own project name
set MyFullPath="%cd%\Transformation"


%MyUVS% /projectfiles %MyFullPath%.uproject

%MyUBT% Development Win64 -Project=%MyFullPath%.uproject -TargetType=Editor -Progress -NoEngineChanges -NoHotReloadFromIDE

%MyFullPath%.uproject

%MyFullPath%.sln

I hope this answer is also useful for others in the future!

Second Person Shooter
  • 14,188
  • 21
  • 90
  • 165
  • What should I call this file? Where should I save it? How can I use it? – Behzad Apr 06 '23 at 22:07
  • This is a windows batch file. They're saved with the .bat extension and executed with the command line (cmd.exe). – Salami May 28 '23 at 05:56