Left 4 Dead 2

Left 4 Dead 2

49 ratings
VPK Un-/Packing shell extension
By мяFunreal
A guide that quickly teaches you how to pack and unpack vpk's by right clicking folders and vpk files
   
Award
Favorite
Favorited
Unfavorite
Foreword
When creating mods, you must pack them into a vpk file. This is done by dragging a folder onto the vpk.exe. This is a super pain when you quickly want to pack it without having to drag the file across your ultrawide screen.

So, if you follow this little guide perfectly you will be able to right click a folder and pack it into a vpk file right there. You will even be able to pack multiple folders at once.


Registry edit file
Create a text file with a name of your choice, that ends in ".reg" For example "VPK_Packer.reg.
Edit the file contents to contain the text of the following github page.
VPK_Packer on Github.[github.com]

Because Steam Guides switch crucial things like \\ to / sometimes, which break the entire code, i've hosted just the reg file on github. Thanks steam :)


Edit and install
Once you have that .reg file, alter the hard drive letters and the paths if you need to.
Just don't forget that just like in that code, it does need \\.
Then you simply double click the reg file. It asks you if you wanna trust it and run it.
Click yes. You might need to restart explorer.exe via taskmanager, or log out and back in.

IF it doesn't work for you, try swapping all single \ with double \\ in the Hkey brackets.
Some people claim this helps, while i never needed it.


Icons
As the code mentions, you can change the icons.
I had used the L4D2 SDKLauncher for the old steam logo.
You could also use steam.exe itself, or Crowbar if you have it.

Any system .dll, .exe, or simple .ico can be used to display the packer in the context menu.
Just like file file shortcuts can do it.

But how the heck would you even know the actual code in a text only format?
Don't worry, I got that covered too.
This Powershell script here does the job.[github.com]
  1. Download the file, or create a .ps1 file with its content.
  2. Make a shortcut to literally any file. Utterly irrelevant what file.
  3. Right click the shortcut and pick a new icon for the shortcut.
    In this mage here i used an obscure icon from "moricons.dll"
  4. Run the powershell script and drag your file shortcut onto it.
    It will tell you the entire code, as well as copy it into your clipboard.
  5. Replace the icon part in the reg file with what the powershell script had given you.

Uninstall
To uninstall, press the Windows key to open the Start menu and type out "Regedit".
Usually "Reg" would be enough to see the Registry editor to pop up in the search.

Its icon looks like a bunch of cubes.


Copy paste the following text into the text box on top:
HKEY_CLASSES_ROOT\Directory\shell\toVPK2
The toVPK2 part will be different if you chose to edit the .reg file.

Delete the entire ToVPK2 folder


do the exact same with
HKEY_CLASSES_ROOT\Directory\Background\shell\toVPK2
and
HKEY_CLASSES_ROOT\SystemFileAssociations\.vpk

To apply these changes, most people tell you to reboot your pc, but that is nonsense.
Open any folder, literally any. Doesn't matter.
Open the task manager, right click Windows Explorer and restart it.
25 Comments
lazz 12 Sep, 2023 @ 9:34am 
Thank you. In the process it saves a minute or 1.5 minutes, not much, but nice :)
мяFunreal  [author] 3 Mar, 2023 @ 3:09am 
@Alyx Maybe read the code. it literally tells you
мяFunreal  [author] 3 Mar, 2023 @ 3:07am 
To delete the unpack, the key will be set in Computer/HKEY_CLASSES_ROOT/SystemFileAssociations/.vpk/shell/Unpack
МаЯоLа® (✌゚∀゚)☞ 3 Mar, 2023 @ 12:42am 
Could you please teach how to remove it manually in the registry? I follow the path but I don't find "systemfileassociations"
Azu 2 Mar, 2023 @ 6:19pm 
would this be possible with portal 2?
мяFunreal  [author] 22 Apr, 2021 @ 8:21pm 
manually delete the registry keys
presents_for_free 22 Apr, 2021 @ 3:22pm 
Do you know how to uninstall it? I don't really want it anymore, since i don't do a lot of modding for Left 4 Dead anymore.
Cleileen41496 19 Sep, 2020 @ 6:24am 
Unpack doesn't works for me too !!
ßαsταrÐ 15 Sep, 2020 @ 7:54am 
Nice guide. Helpful not just for L4D2 but the whole Source catalog, and gives me a better picture of what registry editor is for / capable of. I'll remember that when I'm modding other games.
Barnie Sandlers 5 Feb, 2020 @ 8:20am 
So the Unpack portion of the code isn't working for me. It's just asking me what program I wanna open the .vpk file with.