# RunUAT BuildCookRun deletes AutomationScripts folder

**URL:** <https://forums.unrealengine.com/t/runuat-buildcookrun-deletes-automationscripts-folder/337013>\
**Category:** Platform & Builds\
**Tags:** automationtool, runuatbat-error, runuatbat, unreal-engine, Automation, question\
**Created:** [October 30, 2015, 11:54pm UTC](https://forums.unrealengine.com/t/runuat-buildcookrun-deletes-automationscripts-folder/337013 "2015-10-30T23:54:48Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_b541e29c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b541e29c](https://forums.unrealengine.com/u/anonymous_user_b541e29c)\
**Post date:** [October 30, 2015, 11:54pm UTC](https://forums.unrealengine.com/t/runuat-buildcookrun-deletes-automationscripts-folder/337013/1 "2015-10-30T23:54:48Z")

</div>

I’m trying to follow this wiki to package my game:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

As posted in the wiki, I’m running this command line:

```
C:\>"c:\Program Files\Epic Games\4.8\Engine\Build\BatchFiles\RunUAT.bat" BuildCookRun -project="" -noP4 -platform=Win64 -clientconfig=Development -serverconfig=Development -cook -allmaps -build -stage -pak -archive -archivedirectory="c:\output"
```

Here’s the problem – the script first deletes this folder:

```
Automation.Process: Compiling scripts.
ScriptCompiler.CleanupScriptsAssemblies: Cleaning up script DLL folder
InternalUtils.SafeDeleteDirectory: SafeDeleteDirectory c:\Program Files\Epic Games\4.8\Engine\Binaries\DotNET\AutomationScripts
```

The script goes on to delete that folder and all its contents, and then immediately afterwards it complains that the folder isn’t here:

```
ScriptCompiler.LoadPreCompiledScriptAssemblies: Loading precompiled script DLLs
ScriptCompiler.LoadPreCompiledScriptAssemblies: ERROR: Scripts folder c:\Program Files\Epic Games\4.8\Engine\Binaries\DotNET\AutomationScripts does not exist!
Program.Main: ERROR: AutomationTool terminated with exception:
Program.Main: ERROR: Exception in AutomationTool: AutomationScripts.Automation.dll was not found or could not be loaded,
 can't run scripts.
Stacktrace: at AutomationTool.ScriptCompiler.LoadPreCompiledScriptAssemblies(List`1 OutScriptAssemblies)
   at AutomationTool.ScriptCompiler.FindAndCompileAllScripts(List`1 AdditionalScriptsFolders)
   at AutomationTool.Automation.Process(String[] CommandLine)
   at AutomationTool.Program.MainProc(Object Param)
   at AutomationTool.InternalUtils.RunSingleInstance(MainProc Main, Object Param)
   at AutomationTool.Program.Main()
Program.Main: ERROR: AutomationScripts.Automation.dll was not found or could not be loaded, can't run scripts.
```

Am I doing something wrong? I’m not sure why the batch file would nuke the folder and then complain that it is missing… Can someone help?

thanks,  
sam

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_976db221](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_976db221](https://forums.unrealengine.com/u/anonymous_user_976db221)\
**Post date:** [November 3, 2015, 7:47pm UTC](https://forums.unrealengine.com/t/runuat-buildcookrun-deletes-automationscripts-folder/337013/2 "2015-11-03T19:47:49Z")

</div>

I’m having the exact same issue at the moment.  
Any help on this problem would be greatly appreciated.

Thanks in advance,  
,

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b541e29c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b541e29c](https://forums.unrealengine.com/u/anonymous_user_b541e29c)\
**Post date:** [November 4, 2015, 2:48am UTC](https://forums.unrealengine.com/t/runuat-buildcookrun-deletes-automationscripts-folder/337013/3 "2015-11-04T02:48:28Z")

</div>

What version of the engine are you using? I’m wondering if jumping to 4.9 will help…

thank,  
sam

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_976db221](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_976db221](https://forums.unrealengine.com/u/anonymous_user_976db221)\
**Post date:** [November 4, 2015, 11:11am UTC](https://forums.unrealengine.com/t/runuat-buildcookrun-deletes-automationscripts-folder/337013/4 "2015-11-04T11:11:52Z")

</div>

I am using 4.7. So it might be a good idea to jump to 4.9, it’s worth a try

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_976db221](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_976db221](https://forums.unrealengine.com/u/anonymous_user_976db221)\
**Post date:** [November 6, 2015, 1:23pm UTC](https://forums.unrealengine.com/t/runuat-buildcookrun-deletes-automationscripts-folder/337013/5 "2015-11-06T13:23:01Z")

</div>

Sam, did you manage to solve the problem?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b541e29c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b541e29c](https://forums.unrealengine.com/u/anonymous_user_b541e29c)\
**Post date:** [November 6, 2015, 9:10pm UTC](https://forums.unrealengine.com/t/runuat-buildcookrun-deletes-automationscripts-folder/337013/6 "2015-11-06T21:10:47Z")

</div>

,

I haven’t been able to fix. I’m not able to upgrade easily right now, so I started diving into the source code to try to figure out if something is going wrong. I was able to add some flags which got me slightly further but there was just a different crash/error at that point. I’ll try to let you know…

Were you able to make any further progress?

thanks,  
sam

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_976db221](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_976db221](https://forums.unrealengine.com/u/anonymous_user_976db221)\
**Post date:** [November 8, 2015, 10:52am UTC](https://forums.unrealengine.com/t/runuat-buildcookrun-deletes-automationscripts-folder/337013/7 "2015-11-08T10:52:56Z")

</div>

Sam,  
Unfortunately I was not able to make any progress either.  
Upgrading to 4.9 didn’t solve the problem.

I’ll keep searching the forum and try to find an answer, but up to this point I was not able to find much information regarding this topic.  
I let you know if I make any progress.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_df0ba6a8](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_df0ba6a8](https://forums.unrealengine.com/u/anonymous_user_df0ba6a8)\
**Post date:** [November 13, 2015, 4:16pm UTC](https://forums.unrealengine.com/t/runuat-buildcookrun-deletes-automationscripts-folder/337013/8 "2015-11-13T16:16:10Z")

</div>

Hi,

with the -compile option on, it seems to behave this way. I’ve gotten it to work with the following 2 steps:

1. Re-verify your engine using the epic games launcher which will rebuild your scripts directory.
2. Remove the -compile option or change to -nocompile in your runUAT command parameters.

With the compile option on, I can only get it to compile in the editor… not in a batch command by running the same build parameters that were in the editor log outside in an dos prompt. If someone has solved this problem, please let me know. As I have to compile manually in the editor before triggering a build in my jenkins server which makes my build less automated.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_976db221](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_976db221](https://forums.unrealengine.com/u/anonymous_user_976db221)\
**Post date:** [November 18, 2015, 5:08pm UTC](https://forums.unrealengine.com/t/runuat-buildcookrun-deletes-automationscripts-folder/337013/9 "2015-11-18T17:08:42Z")

</div>

RichardSo, which engine version do you use?  
I have tested it with 4.7 and 4.9 but still get errors.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_df0ba6a8](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_df0ba6a8](https://forums.unrealengine.com/u/anonymous_user_df0ba6a8)\
**Post date:** [November 19, 2015, 3:55am UTC](https://forums.unrealengine.com/t/runuat-buildcookrun-deletes-automationscripts-folder/337013/10 "2015-11-19T03:55:23Z")

</div>

I use 4.9. This is my shell script which I use in Jenkins CI tool:  
For Android:  
/Users/Shared/UnrealEngine/4.9/Engine/Build/BatchFiles/RunUAT.command BuildCookRun -rocket -nocompile -nocompileeditor -installed -nop4 -project=“$projectfile” -cook -stage -archive -archivedirectory=“$outputdir” -package -clientconfig=$buildtype -ue4exe=UE4Editor -clean -compressed -CookAll -pak -prereqs -distribution -nodebuginfo -targetplatform=Android -build -utf8output

For iOS

> /Users/Shared/UnrealEngine/4.9/Engine/Build/BatchFiles/RunUAT.command BuildCookRun -rocket -nocompile -nocompileeditor -installed -nop4 -project=“$projectfile” -cook -stage -archive -archivedirectory=“$outputdir” -package -clientconfig=$buildtype -ue4exe=UE4Editor -clean -compressed -CookAll -pak -prereqs -distribution -nodebuginfo -targetplatform=IOS -build -utf8output

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_976db221](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_976db221](https://forums.unrealengine.com/u/anonymous_user_976db221)\
**Post date:** [November 23, 2015, 5:05pm UTC](https://forums.unrealengine.com/t/runuat-buildcookrun-deletes-automationscripts-folder/337013/11 "2015-11-23T17:05:23Z")

</div>

Do you only package for Android and iOS or also for Windows?  
At the moment I am focussing on Windows and possibly going to package for Andorid and iOS in the future.

If you package for Windows do you only change the targetplatform to Win64 in this command?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_df0ba6a8](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_df0ba6a8](https://forums.unrealengine.com/u/anonymous_user_df0ba6a8)\
**Post date:** [November 23, 2015, 5:11pm UTC](https://forums.unrealengine.com/t/runuat-buildcookrun-deletes-automationscripts-folder/337013/12 "2015-11-23T17:11:41Z")

</div>

I currently only build for Android and iOS. But you can retrieve the command issued by the editor from the console output when you package your project within the editor. That is how I figured out the parameters to use … by looking at the console log and checking what was submitted when I triggered the packaging process from the editor.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_976db221](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_976db221](https://forums.unrealengine.com/u/anonymous_user_976db221)\
**Post date:** [November 23, 2015, 5:25pm UTC](https://forums.unrealengine.com/t/runuat-buildcookrun-deletes-automationscripts-folder/337013/13 "2015-11-23T17:25:29Z")

</div>

Thank you.  
I will look into it

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_976db221](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_976db221](https://forums.unrealengine.com/u/anonymous_user_976db221)\
**Post date:** [November 25, 2015, 9:24am UTC](https://forums.unrealengine.com/t/runuat-buildcookrun-deletes-automationscripts-folder/337013/14 "2015-11-25T09:24:19Z")

</div>

Hi RichardSo,

I changed the command and as I result I don’t get this error anymore but unfortunately a different one. Looks like it has to do with the UnrealHeaderTool.  
The version of the editor that I’m using is 4.9

This is the error message from the log:

008UnrealBuildTool: ERROR: Couldn’t find target rules file for target ‘UnrealHeaderTool’ in rules assembly ‘UE4ModuleRules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’.  
008UnrealBuildTool: Location: C:\Program Files\Epic Games\4.9\Engine\Intermediate\Build\BuildRules\UE4ModuleRules.dll  
008UnrealBuildTool: Target rules found:  
008UnrealBuildTool: UE4Editor - C:\Program Files\Epic Games\4.9\Engine\Source\UE4Editor.Target.cs  
008UnrealBuildTool: UE4Game - C:\Program Files\Epic Games\4.9\Engine\Source\UE4Game.Target.cs  
008UnrealBuildTool: UnrealHeaderTool failed for target ‘Editor’ (platform: Win64, module info: D:\ UnrealEngine\Project\Intermediate\Build\Win64\Editor\Development\UnrealHeaderTool.manifest).

Did you came across this error or do you see this one for the first time now?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_df0ba6a8](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_df0ba6a8](https://forums.unrealengine.com/u/anonymous_user_df0ba6a8)\
**Post date:** [November 25, 2015, 5:44pm UTC](https://forums.unrealengine.com/t/runuat-buildcookrun-deletes-automationscripts-folder/337013/15 "2015-11-25T17:44:35Z")

</div>

I Haven’t seen this error before. I would verify my UE4 installation again (from the epic games launcher) and then try to package from the editor again.

---

<div class="post-metadata">

**Author:** ![theonecalledtom](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@theonecalledtom](https://forums.unrealengine.com/u/theonecalledtom)\
**Post date:** [January 25, 2016, 9:48pm UTC](https://forums.unrealengine.com/t/runuat-buildcookrun-deletes-automationscripts-folder/337013/16 "2016-01-25T21:48:26Z")

</div>

When this happened to me a few days ago verifying the engine install fixed things. The problem was instigated by copying a RunUAT script with -compile on - seems that it would be good to do some error checking BEFORE deleting installed files!
