我在玩《流亡之路》中的一些插件。在这个论坛的帮助下,我编写了一个脚本,该脚本以单个批处理文件启动所有插件,然后启动游戏。现在,我还希望它在游戏关闭时关闭所有插件。我愿意使用PowerShell,但我不知道如何使用。我也不知道如何将已经编写的内容转换为PowerShell。代码如下。谢谢!
@echo off
:: BatchGotAdmin
::-------------------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params = %*:"="
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
pushd "%CD%"
CD /D "%~dp0"
::--------------------------------------
::ENTER YOUR CODE BELOW:
runas /noprofile /user:CARLOSDESKTOP\resur /savecred "C:\Games (C SSD)\PoE\Addons\Exiled Presence v1.0.5\Exiled-Presence.exe"
runas /noprofile /user:CARLOSDESKTOP\resur /savecred "C:\Games (C SSD)\PoE\Addons\poe-overlay\poe-overlay.exe"
cd /d "C:\Games (C SSD)\PoE\Addons\Awakened PoE Trade"
start "" "C:\Games (C SSD)\PoE\Addons\Awakened PoE Trade\Awakened PoE Trade.exe"
cd /d "C:\Games (C SSD)\PoE\Addons\Autoflask"
start "" "C:\Games (C SSD)\PoE\Addons\Autoflask\PoEAutoFlask.ahk"
cd /d "C:\Games (C SSD)\PoE\Addons\POE-Trades-Companion-dev"
start "" "C:\Games (C SSD)\PoE\Addons\POE-Trades-Companion-dev\POE Trades Companion.ahk"
cd /d "C:\Games (C SSD)\PoE"
start "" "C:\Games (C SSD)\PoE\PathOfExile_x64.exe"