Minecraft Blogs / Tutorial

How to change your entire Minecraft directory - create a portable Minecraft USB [Advanced Guide]

  • 39,570 views, 28 today
  • 11
  • 8
  • 32
Leomelonseeds avatar Leomelonseeds
Level 63 : High Grandmaster Engineer
44
Note that this only works for Windows PCs.

The .minecraft folder is the folder is where all your Minecraft data, including resource packs, worlds, and versions, are stored. The default location of this folder is "C:Users\youruser\Appdata\Roaming\.minecraft".

Changing the "Game Directory" option in the Minecraft launcher only puts your saves, resource packs and versions in the specified directory. This is a method that will put your entire .minecraft folder in a specified directory. This allows you to change all your Minecraft files to wherever you want on your computer. This also allows you to have Minecraft on a portable USB!

Prerequisites:
  • You are using a PC, not a MAC
  • You are using the alternative download version of Minecraft, the "Minecraft.exe" file. Note that Minecraft.exe can be obtained by clicking "alternative download" here.

Instructions:
1. Create a new text document and put it anywhere. To make things easier, it is recommended that you create the file in the same directory as your Minecraft.exe file.

2. Open the text document and type this line:
"path to Minecraft.exe" --workDir "path to .minecraft folder"
What is a "path""?
Windows command line path
A windows path can tell your computer to look for a certain folder or file. For example, for most people the default location of their .minecraft folder is "C:\Users\youruser\Appdata\Roaming\.minecraft" If your Minecraft.exe file is on your desktop, the path to that would be "C:\Users\youruser\Desktop\Minecraft.exe".


Change "path to Minecraft.exe" to where your Minecraft.exe file is, and change "path to .minecraft folder" to the desired location of your .minecraft folder. Your desired Minecraft folder MUST be named ".minecraft", or this method will not work.

Here is an example file I created:
How to change your entire Minecraft directory - create a portable Minecraft USB [Advanced Guide]
As you can see, my Minecraft.exe file is located in a folder on my desktop called "Minecraft", while my .minecraft folder is also in the same folder.

3. Click "file", then "Save as". In the file type section, select "all files" or "batch file" and rename the file to "start.bat". You can save this file anywhere you want. Click save. Make sure that the file is a batch file and the icon is those two little gears. If not, change the file extension to ".bat". You can now delete the original text document you created. Note that the file does not need to be named "start.bat", you can name it to anything you want, as long as it is a batch file.
What is a batch file?
This file uses Windows' "batch" scripting to run your Minecraft.exe file, using the --workDir option to change your game directory to the .minecraft folder you want.



4. Double click the batch file, and after a while you should see the launcher start up. In the profile settings, the game directory should be automatically set to your .minecraft folder.

5. Run Minecraft and enjoy! If it doesn't work, please leave a comment.

Additional Tips for a Portable Minecraft USB:
  • Your USB may change the drive letter when plugged into different computers. Because of this, your Minecraft.exe file and .minecraft folder must be in the same folder or a sub-folder of your batch file.
  • You cannot use drive letters for the paths in your batch file. Reference the files directly.
    Example
    My USB looks like this:
    How to change your entire Minecraft directory - create a portable Minecraft USB [Advanced Guide]

    My Minecraft.exe and .minecraft are located in the "Data" folder. This is what my batch script (Minecraft.bat) looks like:



  • You can literally plug this USB in to ANY computer running Windows and play Minecraft. Even a school computer


Hope this helped :)
Tags

4 Update Logs

Update #4 : by Leomelonseeds 12/29/2020 1:59:28 amDec 29th, 2020

- Failed to find a suitable method for Mac, removed the text from the introduction.
- Fixed the hyperlink for Minecraft launcher alternative download, since they changed it.
LOAD MORE LOGS

Create an account or sign in to comment.

1
05/09/2022 8:29 pm
Level 20 : Expert Miner
GoodOldIsha
GoodOldIsha avatar
How would I get this to work with the old launcher?
1
05/11/2022 6:45 pm
Level 20 : Expert Miner
GoodOldIsha
GoodOldIsha avatar
Nevermind, I found a way
In case anyone else is looking for this specifically, do the same thing with the .bat file but change the compatibility (found by right clicking and going to properties) to Windows XP service pack 2. I had to fiddle with things in the launcher a bit after that but I don't remember exactly but that's the main thing.
1
03/02/2022 3:52 pm
Level 1 : New Miner
User4065105G
User4065105G avatar
Note:

you can also go to %appdata%\.minecraft\

and also, it's not "C:Users\youruser\Appdata\Roaming\.minecraft" it's "C:\Users\youruser\Appdata\Roaming\.minecraft"
1
07/09/2021 4:19 pm
Level 6 : Apprentice Miner
epicman1234
epicman1234 avatar
This doesn't work...
1
07/09/2021 4:11 pm
Level 6 : Apprentice Miner
epicman1234
epicman1234 avatar
Are the quotes for the batch file required?
1
07/11/2021 6:58 pm
Level 63 : High Grandmaster Engineer
Leomelonseeds
Leomelonseeds avatar
Yes they are. What do you mean exactly when you say it doesn't work? What is the issue?
1
09/23/2019 11:07 pm
Level 1 : New Miner
Kid_Vegeta
Kid_Vegeta avatar
This worked for me! Thanks, Leomelonseeds!
1
09/29/2019 1:35 pm
Level 63 : High Grandmaster Engineer
Leomelonseeds
Leomelonseeds avatar
No problem, glad I could help
1
07/01/2019 9:48 am
Level 1 : New Crafter
AlSh_7i
AlSh_7i avatar
Can I launch the Minecraft.exe by itself after I launched the start.bat?
1
07/01/2019 3:28 pm
Level 63 : High Grandmaster Engineer
Leomelonseeds
Leomelonseeds avatar
Sorry, you must use the start.bat every single time.
Planet Minecraft

Website

© 2010 - 2022
www.planetminecraft.com

Welcome