# How to use unrealpak.exe to build pak

**URL:** <https://forums.unrealengine.com/t/how-to-use-unrealpak-exe-to-build-pak/403533>\
**Category:** Platform & Builds\
**Tags:** build, unreal-engine, UE4, CPP, question\
**Created:** [September 2, 2017, 10:30am UTC](https://forums.unrealengine.com/t/how-to-use-unrealpak-exe-to-build-pak/403533 "2017-09-02T10:30:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ggalt](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ggalt](https://forums.unrealengine.com/u/ggalt)\
**Post date:** [September 2, 2017, 10:30am UTC](https://forums.unrealengine.com/t/how-to-use-unrealpak-exe-to-build-pak/403533/1 "2017-09-02T10:30:59Z")

</div>

i want to use unrealpak.exe to build pak, only with one file, which command line i can use ? and i want compress it, which param can use?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_10b75a231](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_10b75a231](https://forums.unrealengine.com/u/anonymous_user_10b75a231)\
**Post date:** [February 8, 2018, 5:43am UTC](https://forums.unrealengine.com/t/how-to-use-unrealpak-exe-to-build-pak/403533/2 "2018-02-08T05:43:24Z")

</div>

If you run UnrealPak.exe without any parameters, it shows this usage:

```
Usage:
UnrealPak <PakFilename> -Test
UnrealPak <PakFilename> -List
UnrealPak <PakFilename> <GameUProjectName> <GameFolderName> -ExportDependencies=<OutputFileBase> -NoAssetRegistryCache -ForceDependsGathering
UnrealPak <PakFilename> -Extract <ExtractDir>
UnrealPak <PakFilename> -Create=<ResponseFile> [Options]
UnrealPak <PakFilename> -Dest=<MountPoint>
UnrealPak GenerateKeys=<KeyFilename>
UnrealPak GeneratePrimeTable=<KeyFilename> [-TableMax=<N>]
UnrealPak <PakFilename1> <PakFilename2> -diff
UnrealPak -TestEncryption
Options:
  -blocksize=<BlockSize>
  -bitwindow=<BitWindow>
  -compress
  -encrypt
  -order=<OrderingFile>
  -diff (requires 2 filenames first)
  -enginedir (specify engine dir for when using ini encryption configs)
  -projectdir (specify project dir for when using ini encryption configs)
  -encryptionini (specify ini base name to gather encryption settings from)
  -encryptindex (encrypt the pak file index, making it unusable in unrealpak without supplying the key)

```

In your case, you would want to run:

```
> Engine\Binaries\Win64\UnrealPak.exe X:\dest\somepak.pak -Create=X:\source\ -compress

```

---

<div class="post-metadata">

**Author:** ![ggalt](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ggalt](https://forums.unrealengine.com/u/ggalt)\
**Post date:** [March 17, 2018, 3:59am UTC](https://forums.unrealengine.com/t/how-to-use-unrealpak-exe-to-build-pak/403533/3 "2018-03-17T03:59:22Z")

</div>

thank you~ but -Create=X:\source\ is package the all dir, i want to package only one file…

---

<div class="post-metadata">

**Author:** ![NextWorldVR](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NextWorldVR](https://forums.unrealengine.com/u/NextWorldVR)\
**Post date:** [October 26, 2018, 3:39am UTC](https://forums.unrealengine.com/t/how-to-use-unrealpak-exe-to-build-pak/403533/4 "2018-10-26T03:39:44Z")

</div>

So only put one file in that ‘source’ folder, or ALL files from the original pak and the NEW ONE in place. …

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_10b75a231](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_10b75a231](https://forums.unrealengine.com/u/anonymous_user_10b75a231)\
**Post date:** [October 26, 2018, 9:09am UTC](https://forums.unrealengine.com/t/how-to-use-unrealpak-exe-to-build-pak/403533/5 "2018-10-26T09:09:08Z")

</div>

Sorry I just saw your reply! You can set `-Create=X:\responsefile.txt`. Inside you can write patterns for which files are added to the pak, and you can even rebase (change the filepaths of) the files that get discovered.

How to write a responsefile is documented a bit here: [https://www.cnblogs.com/linqing/p/5100518.html](https://www.cnblogs.com/linqing/p/5100518.html)

Excerpt:

```
UnrealPak.exe D:\MyAssetPak.pak -create=PathToResponseFile.txt

```

where the ResponseFile could be:

Code:

```
..\..\..\Engine\Content\Editor\Slate\*.*
..\..\..\Engine\Content\Localization\*.*
..\..\..\Engine\Shaders\*.*
..\..\..\Engine\config\*.*
PathToYourProject\*.uproject
PathToYourProject\Config\*.*
PathToYourProject\Content\Localization\*.*
PathToYourProject\Saved\Sandboxes\Cooked-WindowsNoEditor\Engine\*.* ..\..\..\Engine\*.*
PathToYourProject\Saved\Sandboxes\Cooked-WindowsNoEditor\ProjectName\*.* ..\..\..\ProjectName\*.*

```

Note that the last two lines re-base the content from Cooked folder to Content folder.
