Whoever is stuck with this problem. please check this:
Generate Visual Studio Files with a batch file
My Batch looks like this:
echo on
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="C:\Program Files\Epic Games\UE_5.4\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.exe"
rem change Transformation to your own project name
d:
set MyFullPath="%cd%\Transformation"
set MyFullPath="D:\FuncLibTest2\FuncLibtest2\FuncLibtest2"
pause
%MyUVS% /projectfiles %MyFullPath%.uproject
%MyUBT% Development Win64 -Project=%MyFullPath%.uproject -TargetType=Editor -Progress -NoEngineChanges -NoHotReloadFromIDE
pause
%MyFullPath%.uproject
%MyFullPath%.sln