Run multiple D2R instances
by Antoine - categories : Games Diablo
The following method will let you run two Diablo 2 Resurrected instances at once on the same machine. No need to struggle with a sandbox or a virtual machine, the trick is to close a handle within the game (D2R.exe) process. This handle is the one that checks if any D2R instances already exists. If closed, another D2R.exe process will be able to start.
Prerequisites
- Two or more Battle.net accounts with D2R
Setup and configure D2R/bnet
- Install D2R (default dir will be "C:\Program Files (x86)\Diablo II Resurrected")
- Duplicate the D2R directory, name it something like "C:\Program Files (x86)\Diablo II Resurrected_alt"
- In the Battle.net launcher, go to the launcher's settings :
- Set Battle.net client to exit on game launch
- Uncheck "Keep me logged in"
- (optional) Create two shortcuts to your Desktop :
- One named "D2R" pointing to "C:\Program Files (x86)\Diablo II Resurrected\Diablo II Resurrected Launcher.exe"
- The second "D2R_alt" to "C:\Program Files (x86)\Diablo II Resurrected_alt\Diablo II Resurrected Launcher.exe"
Setup the multi-instances hack
- Create a new folder in D2R first directory, name it something like "MultiInstances"
- Download Handle Windows process utility (handle64.exe) from Microsoft here, and place it in this directory
- In the same dir, create a new Powershell script, name it like "d2r_stophandles.ps1"
- Copy the following instructions in it and save it
# Run multiples D2R clients
# This script closes Diablo 2 Resurrected following thread handles in order to run multiples D2R clients on the same computer :
# - Event "DiabloII Check For Other Instances"
# - Section "windows_shell_global_counters"
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
{
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit
}
& "$PSScriptRoot\handle64.exe" -accepteula -a -p D2R.exe > $PSScriptRoot\d2r_handles.txt
$proc_id_populated = ""
$handle_id_populated = ""
foreach($line in Get-Content $PSScriptRoot\d2r_handles.txt)
{
$proc_id = $line | Select-String -Pattern '^D2R.exe pid\: (?<g1>.+) ' | %{$_.Matches.Groups[1].value}
if ($proc_id)
{
$proc_id_populated = $proc_id
}
$handle_id = $line | Select-String -Pattern '^(?<g2>.+): Event.*DiabloII Check For Other Instances' | %{$_.Matches.Groups[1].value}
if ($handle_id)
{
$handle_id_populated = $handle_id
}
if ($handle_id)
{
Write-Host "Closing" $proc_id_populated $handle_id_populated
& "$PSScriptRoot\handle64.exe" -p $proc_id_populated -c $handle_id_populated -y
}
}
read-host "Press ENTER to continue..."
- (optional) You can test/run it while D2R is running, the output should be like :
Closing 17140 7D4
Nthandle v5.0 - Handle viewer
Copyright (C) 1997-2022 Mark Russinovich
Sysinternals - www.sysinternals.com
7D4: Event \Sessions\1\BaseNamedObjects\DiabloII Check For Other Instances
Handle closed.
Press ENTER to continue...:
- (optional) If Windows security policy prevents running ps scripts, open an Admin Powershell window and run
Set-ExecutionPolicy RemoteSigned
. This will only allow unsigned scripts created on the local machine to be executed. - (optional) Create a Desktop shortcut to the script, (name "d2r_stophandles")
How to use
- If you followed all the previous instructions, you now have 3 shortcuts on your Desktop :
- D2R (starts the game from original directory)
- D2R_alt (starts the game from alternate directory)
- d2r_stophandles (starts the D2R.exe handle termination ps script)
- Run "D2R" > login to your first Bnet account > run Diablo ("Play" button)
- Wait to be in the lobby screen
- Run "d2r_stophandles" > the output should report that the handle have been closed
- Run "D2R_alt", login to your second Bnet account, run Diablo
Two D2R instances are now running from two differents accounts running at the same time. Technically, this method should work for more than 2 accounts.
Be the first to comment 🡮