fogarty

gw2multibat

Mar 16th, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.13 KB | None | 0 0
  1. ::TESTED ONLY ON WINDOWS 7 64 bit ENGLISH version (Using english word: "Console" when cleaning variables)
  2. ::EVERYTHING is done with trial and error!
  3. ::This bat file closes Guild Wars 2 "AN-Mutex-Window-Guild" handle so you can launch multiple clients. Scroll down for more info.
  4. ::------------------------------------------------------------------------------------------
  5. :: 1) Start first/main account. To disable/enable: add/remove :: at the start. Use your file location! Jump to part 4 for second client.
  6. ::start /b "" "[MAIN GW2 .exe location]"
  7. ::start /b "" "C:\Pelit\Guild Wars 2\Gw2.exe"
  8.  
  9. :: 1.5)
  10. ::Waiting x milliseconds. To disable/enable: add/remove :: at the start.
  11. ping 1.1.1.1 -n 1 -w 1000 > nul
  12.  
  13. :: 2)
  14. ::Get handle ID and process ID and save it was txt file
  15. handle -a -p gw2.exe | findstr /i /R AN-Mutex-Window-Guild > GW2HandleTMP.txt
  16. tasklist | findstr /i /R Gw2.exe > GW2PIDTMP.txt
  17. ::Set handle ID and process ID as parameters
  18. set /P VAR11=<GW2PIDTMP.txt
  19. set /p VAR1=<GW2HandleTMP.txt
  20. ::Cleaning strings
  21. SET _endbit1=%VAR1:*:=%
  22. CALL SET VAR2=%%VAR1:%_endbit1%=%%
  23. SET _endbit11=%VAR11:*Console=%
  24. CALL SET VAR21=%%VAR11:%_endbit11%=%%
  25. SET VAR3=%VAR2::= %
  26. SET VAR31=%VAR21:Console= %
  27. SET VAR41=%VAR31:Gw2.exe= %
  28. SET VAR4=%VAR3: =%
  29. SET VAR51=%VAR41: =%
  30.  
  31. :: 3)
  32. ::Closing "AN-Mutex-Window-Guild" handle
  33. handle -c %VAR4% -y -p %VAR51%
  34.  
  35.  
  36. :: 4) Start second/alt account. To disable/enable: add/remove :: at the start.
  37. ::Use your second windows account and new Guild Wars 2 folder location.
  38. ::Asks windows user password only on first time. Keep writing your windows use
  39. ::C:\Windows\System32\runas.exe /savecred /user:[WINDOWS USER] "[2nd GW2 .exe location]"
  40. C:\Windows\System32\runas.exe /savecred /user:gw3 "D:\Pelit\Guild Wars 2\Gw2.exe"
  41.  
  42. :: 5)
  43. del GW2HandleTMP.txt
  44. del GW2PIDTMP.txt
  45.  
  46. ::------------------------------------------------------------------------------------------
  47. ::Preparations
  48. ::-Create second windows account, Change part 4 user^. (Need 2nd user for another local.dat file)
  49. ::-Create second copy of Guild Wars 2 folder, Change part 4 folder (-sharearchive doesn't work with this thing)
  50.  
  51.  
  52.  
  53. ::You need Handle.exe from microsoft technet (https://technet.microsoft.com/en-us/sysinternals/bb896655.aspx)
  54. ::Copy/paste handle.exe in C:\Windows\System32. You can test it by opening cmd and typing: handle, if error, google.
  55.  
  56. ::What this should do is
  57. :: 1) Start main client. Use your file location path!
  58. :: 1.5) timer
  59. :: 2) Find IDs, cleans/trims strings and set ID as parameter. (Saves temp txt file because I don't know how to use CMD... Files can be removed after client launches(or are removed automatically...))
  60. :: 3) Close "AN-Mutex-Window-Guild" handle
  61. :: 4) Launch second client. Use your file location path AND windows user account!
  62.  
  63. ::Handle.exe, https://technet.microsoft.com/en-us/sysinternals/bb896655.aspx
  64. ::Close handle idea, http://www.guildwars2guru.com/topic/582-multiple-guild-wars-2-clients-running-on-1-computer/#entry21242
  65. ::Variable cleaning, http://ss64.com/nt/syntax-replace.html
  66. ::Wait x ms, http://stackoverflow.com/questions/1672338/how-to-sleep-for-5-seconds-in-windowss-command-prompt-or-dos
Advertisement
Add Comment
Please, Sign In to add comment