-
Contributor
I wrote a batch script that will launch Path of exile, alongside some other scripts I have running alongside POE. I know this in itself is not very special, but this batchfile actually checks first if the game or scripts are open and it will not re-launch a new instance of the files.
Store the batch file somewhere it can stay (filename.bat), then make a shortcut to the batch file on your desktop. Select properties and then launch minimized. Now when you run the batch file it will check if the game is open, and check if all your scripts are open.
There are REMarks in the batch file to help make modifications. It is set up to launch WingmanReloaded, TradeMacro and Trades Companion but this should work for any type of script or program. Just launching the game does not require AHK, everything in the Scripts Section will require that AHK is installed.
Code:
SETLOCAL
ECHO OFF
SET run_as=C:\Windows\System32\runas.exe
REM Name of the local user account you are having launch the EXE
SET local_user=ReplaceWithUserName
REM Possible EXE names: PathOfExile.exe, PathOfExile_x64.exe, PathOfExileSteam.exe, PathOfExile_x64Steam.exe, PathOfExile_KG.exe, PathOfExile_x64_KG.exe
SET exe_name=PathOfExile_x64.exe
REM You can launch the game with additional Parameters
SET exe_params=--nologo --waitforpreload
REM Keep in mind because of strange reasons this one must have / instead of \
SET exe_path=C:/Program Files (x86)/Grinding Gear Games/Path of Exile/
REM Make sure to change this drive letter if not on C: drive
CD C:
TASKLIST /fi "IMAGENAME eq %exe_name%" 2>NUL | FIND /I /N "%exe_name%">NUL
IF NOT "%ERRORLEVEL%"=="0" START %run_as% /user:%local_user% /savecred "cmd /C cd \"%exe_path%\" && Start /high %exe_name% %exe_params%"
REM ---------------
REM Scripts Section
REM ---------------
REM Place all scripts in subfolders one directory
SET scripts_path=C:\Path\To\The\Path of Exile\Scripts
REM Name of the script to run
SET script_1_name=PoE-Wingman.ahk
REM Which subdirectory of the scripts folder
SET script_1_subpath=WingmanReloaded
REM What to look for as an active process in AHK
SET script_1_searchString=PoE-Wingman.ahk ahk_exe AutoHotkey.exe
REM Build the Path from supplied values
SET script_1_path=%scripts_path%\%script_1_subpath%\%script_1_name%
REM Script 2
SET script_2_name=Run_TradeMacro.ahk
SET script_2_subpath=POE-TradeMacro
SET script_2_searchString=_TradeMacroMain.ahk ahk_exe AutoHotkey.exe
REM Build the Path
SET script_2_path=%scripts_path%\%script_2_subpath%\%script_2_name%
REM Script 3
SET script_3_name=POE Trades Companion.ahk
SET script_3_subpath=POE-Trades Companion
SET script_3_searchString=%script_3_name% ahk_exe AutoHotkey.exe
REM Build the Path
SET script_3_path=%scripts_path%\%script_3_subpath%\%script_3_name%
REM Send script to AutoHotkey to evaluate for hidden window titles
(
ECHO #NoTrayIcon
ECHO SetTitleMatchMode, 2
ECHO DetectHiddenWindows On
ECHO If !WinExist^("%script_1_searchString%"^^^)
ECHO Run %script_1_path%
ECHO If !WinExist^("%script_2_searchString%"^^^)
ECHO Run %script_2_path%
ECHO If !WinExist^("%script_3_searchString%"^^^)
ECHO Run %script_3_path%
ECHO ExitApp
)| AutoHotkey.exe *
Last edited by thebbandit; 03-03-2020 at 12:30 AM.
WingmanReloaded: https://bandittech.github.io/WingmanReloaded
Browse past issues, submit help request, new bug report or add a feature request: https://github.com/BanditTech/WingmanReloaded/issues
-
Post Thanks / Like - 4 Thanks
-
Member
Hello! Can you tell me why when I run poe as a limited user my connection is extremely slow? This happens right after logging into the account. when I log out, the speed is normal.
-
Member
Originally Posted by
thebbandit
I wrote a batch script that will launch Path of exile, alongside some other scripts I have running alongside POE. I know this in itself is not very special, but this batchfile actually checks first if the game or scripts are open and it will not re-launch a new instance of the files.
Store the batch file somewhere it can stay (filename.bat), then make a shortcut to the batch file on your desktop. Select properties and then launch minimized. Now when you run the batch file it will check if the game is open, and check if all your scripts are open.
There are REMarks in the batch file to help make modifications. It is set up to launch WingmanReloaded, TradeMacro and Trades Companion but this should work for any type of script or program. Just launching the game does not require AHK, everything in the Scripts Section will require that AHK is installed.
Code:
SETLOCAL
ECHO OFF
SET run_as=C:\Windows\System32\runas.exe
REM Name of the local user account you are having launch the EXE
SET local_user=ReplaceWithUserName
REM Possible EXE names: PathOfExile.exe, PathOfExile_x64.exe, PathOfExileSteam.exe, PathOfExile_x64Steam.exe, PathOfExile_KG.exe, PathOfExile_x64_KG.exe
SET exe_name=PathOfExile_x64.exe
REM You can launch the game with additional Parameters
SET exe_params=--nologo --waitforpreload
REM Keep in mind because of strange reasons this one must have / instead of \
SET exe_path=C:/Program Files (x86)/Grinding Gear Games/Path of Exile/
REM Make sure to change this drive letter if not on C: drive
C:
TASKLIST /fi "IMAGENAME eq %exe_name%" 2>NUL | FIND /I /N "%exe_name%">NUL
IF NOT "%ERRORLEVEL%"=="0" START %run_as% /user:%local_user% /savecred "cmd /C cd \"%exe_path%\" && Start /high %exe_name% %exe_params%"
REM ---------------
REM Scripts Section
REM ---------------
REM Place all scripts in subfolders one directory
SET scripts_path=C:\Path\To\The\Path of Exile\Scripts
REM Name of the script to run
SET script_1_name=PoE-Wingman.ahk
REM Which subdirectory of the scripts folder
SET script_1_subpath=WingmanReloaded
REM What to look for as an active process in AHK
SET script_1_searchString=PoE-Wingman.ahk ahk_exe AutoHotkey.exe
REM Build the Path from supplied values
SET script_1_path=%script_path%\%script_1_subpath%\%script_1_name%
REM Script 2
SET script_2_name=Run_TradeMacro.ahk
SET script_2_subpath=POE-TradeMacro
SET script_2_searchString=_TradeMacroMain.ahk ahk_exe AutoHotkey.exe
REM Build the Path
SET script_2_path=%script_path%\%script_2_subpath%\%script_2_name%
REM Script 3
SET script_3_name=POE Trades Companion.ahk
SET script_3_subpath=POE-Trades Companion
SET script_3_searchString=%script_3_name% ahk_exe AutoHotkey.exe
REM Build the Path
SET script_3_path=%script_path%\%script_3_subpath%\%script_3_name%
REM Send script to AutoHotkey to evaluate for hidden window titles
(
ECHO #NoTrayIcon
ECHO SetTitleMatchMode, 2
ECHO DetectHiddenWindows On
ECHO If !WinExist^("%script_1_searchString%"^^^)
ECHO Run %script_1_path%
ECHO If !WinExist^("%script_2_searchString%"^^^)
ECHO Run %script_2_path%
ECHO If !WinExist^("%script_3_searchString%"^^^)
ECHO Run %script_3_path%
ECHO ExitApp
)| AutoHotkey.exe *
I have the same standard setup like you. Does not work. It says it cannot find the executable. But the path does exist of course ^^.
EDIT: after i am entering the password for that user.
Last edited by antroxxx; 03-02-2020 at 08:34 PM.
-
Contributor
Oops I left a typo in place, it had Script_Path instead of Scripts_Path. I fixed the post, copy the new one to fix it.
WingmanReloaded: https://bandittech.github.io/WingmanReloaded
Browse past issues, submit help request, new bug report or add a feature request: https://github.com/BanditTech/WingmanReloaded/issues
-
Member
Originally Posted by
thebbandit
Oops I left a typo in place, it had Script_Path instead of Scripts_Path. I fixed the post, copy the new one to fix it.
oh sorry,
i mean the following is not working without the script part.
Code:
Code:
SETLOCAL
ECHO OFF
SET run_as=C:\Windows\System32\runas.exe
REM Name of the local user account you are having launch the EXE
SET local_user=ReplaceWithUserName
REM Possible EXE names: PathOfExile.exe, PathOfExile_x64.exe, PathOfExileSteam.exe, PathOfExile_x64Steam.exe, PathOfExile_KG.exe, PathOfExile_x64_KG.exe
SET exe_name=PathOfExile_x64.exe
REM You can launch the game with additional Parameters
SET exe_params=--nologo --waitforpreload
REM Keep in mind because of strange reasons this one must have / instead of \
SET exe_path=C:/Program Files (x86)/Grinding Gear Games/Path of Exile/
REM Make sure to change this drive letter if not on C: drive
C:
TASKLIST /fi "IMAGENAME eq %exe_name%" 2>NUL | FIND /I /N "%exe_name%">NUL
IF NOT "%ERRORLEVEL%"=="0" START %run_as% /user:%local_user% /savecred "cmd /C cd \"%exe_path%\" && Start /high %exe_name% %exe_params%"
-
Contributor
Originally Posted by
antroxxx
oh sorry,
i mean the following is not working without the script part.
Code:
Code:
SETLOCAL
ECHO OFF
SET run_as=C:\Windows\System32\runas.exe
REM Name of the local user account you are having launch the EXE
SET local_user=ReplaceWithUserName
REM Possible EXE names: PathOfExile.exe, PathOfExile_x64.exe, PathOfExileSteam.exe, PathOfExile_x64Steam.exe, PathOfExile_KG.exe, PathOfExile_x64_KG.exe
SET exe_name=PathOfExile_x64.exe
REM You can launch the game with additional Parameters
SET exe_params=--nologo --waitforpreload
REM Keep in mind because of strange reasons this one must have / instead of \
SET exe_path=C:/Program Files (x86)/Grinding Gear Games/Path of Exile/
REM Make sure to change this drive letter if not on C: drive
C:
TASKLIST /fi "IMAGENAME eq %exe_name%" 2>NUL | FIND /I /N "%exe_name%">NUL
IF NOT "%ERRORLEVEL%"=="0" START %run_as% /user:%local_user% /savecred "cmd /C cd \"%exe_path%\" && Start /high %exe_name% %exe_params%"
And you have windows installed on the C drive and the game is also installed on the C: drive?
And you have properly replaced the Limited User name with the one you are using?
It should be working, if you have issues, instead Change ECHO OFF to ON
Then place a PAUSE in the code and run it, you can see all the lines of code that were executed up until it pauses. I would put the pause right after the IF NOT errrorlevel etc line
Last edited by thebbandit; 03-02-2020 at 10:45 PM.
WingmanReloaded: https://bandittech.github.io/WingmanReloaded
Browse past issues, submit help request, new bug report or add a feature request: https://github.com/BanditTech/WingmanReloaded/issues
-
Member
Originally Posted by
thebbandit
And you have windows installed on the C drive and the game is also installed on the C: drive?
And you have properly replaced the Limited User name with the one you are using?
It should be working, if you have issues, instead Change ECHO OFF to ON
Then place a PAUSE in the code and run it, you can see all the lines of code that were executed up until it pauses. I would put the pause right after the IF NOT errrorlevel etc line
I got it working now. All fine with your script, dont worry.
But it seems when POE is not on C: . It simply cant find the exe. I tested it with "C:/Games/Poe" -> all fine .... with "D:/..." nope.
-
Contributor
Originally Posted by
antroxxx
I got it working now. All fine with your script, dont worry.
But it seems when POE is not on C: . It simply cant find the exe. I tested it with "C:/Games/Poe" -> all fine .... with "D:/..." nope.
There is a note in the comments right before where you change the code
Code:
Make sure to change this drive letter if not on C: drive
it is a line that just says C:
change that to say D: instead
Last edited by thebbandit; 03-02-2020 at 11:55 PM.
WingmanReloaded: https://bandittech.github.io/WingmanReloaded
Browse past issues, submit help request, new bug report or add a feature request: https://github.com/BanditTech/WingmanReloaded/issues
-
Member
Originally Posted by
thebbandit
There is a note in the comments right before where you change the code
Code:
Make sure to change this drive letter if not on C: drive
it is a line that just says C:
change that to say D: instead
I saw that, it does not work.
-
Contributor
ohh maybe that line needs to read the below, I have not actually tested in on another HD. Mine are pretty full, media server constantly downloading movies XD
Last edited by thebbandit; 03-03-2020 at 12:54 AM.
WingmanReloaded: https://bandittech.github.io/WingmanReloaded
Browse past issues, submit help request, new bug report or add a feature request: https://github.com/BanditTech/WingmanReloaded/issues
-
Member
Originally Posted by
thebbandit
ohh maybe that line needs to read
the below, I have not actually tested in on another HD. Mine are pretty full, media server constantly downloading movies XD
wonderful :-D
-
Member
hm the script wont work , doenst matter if i install it on C or D , changing the pathes in the file.
if i set a user on my windows with password , and use this user in the script , it ask me for the password but i cant type it in the cmd window.
and the wingman wont launch aswell
may u can help me out
okay , now the script try to launch but cannot find the pathofexile_x64.exe
nevermind , i just copied everything to c
but wingman will not load
Last edited by xaiyx; 03-10-2020 at 07:28 AM.
-
Member
Please help, I run Poe Helper but it doesn't work in the game...
-
Member
can you make a bat file to download it?
-
Member
For me with steam version its dont work
even if i try to use this method:
To Run a program as a different user, simply press Shift key and right click on the shortcut or executable you wish to Run as different user. From the right click context menu, select Run as different user.
Steam still opened on main ADMIN Usher. I dont know how to do it work for me