Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bat脚本运行程序,结束游戏后,程序不会自动关闭 #483

Open
635660902 opened this issue Nov 19, 2024 · 6 comments
Open

Comments

@635660902
Copy link

由bat脚本启动unlockfps_nc_signed.exe运行游戏后,关闭游戏不会自动结束unlockfps_nc_signed.exe的进程,程序任会在右下角任务托盘中显示。

@635660902 635660902 changed the title 小问题 bat脚本运行程序,关闭游戏,程序不会自动关闭 Nov 19, 2024
@635660902 635660902 changed the title bat脚本运行程序,关闭游戏,程序不会自动关闭 bat脚本运行程序,结束游戏后,程序不会自动关闭 Nov 19, 2024
@Zebra2711
Copy link

In fps_config.json set "AutoClose": true

If u run game on linux (wayland, NOT XWAYLAND)
run.bat

@echo off
start unlockfps_nc_signed.exe
timeout /t 5 /nobreak >nul
taskkill /f /im explorer.exe

@635660902
Copy link
Author

In fps_config.json set "AutoClose": true

If u run game on linux (wayland, NOT XWAYLAND) run.bat

@echo off
start unlockfps_nc_signed.exe
timeout /t 5 /nobreak >nul
taskkill /f /im explorer.exe

感谢你的回复。我使用的是windows10,在fps_config.json 里,我已经将它设置成了 "AutoClose": true,但是没有生效。
下面是我的bat脚本
start "" "3DMigoto Loader.exe"
start "" "G:\unlockfps\unlockfps_nc_signed.exe"
timeout /t 60 /nobreak >nul
taskkill /im unlockfps_nc_signed.exe

如果使用管理员方式运行bat,那么unlockfps_nc_signed.exe进程就能成功杀死,但3DMigoto Loader.exe将无法正常启动,windows会提示“windows 找不到3DMigoto Loader.exe。请确定文件名是否正确”。使用非管理员运行bat,unlockfps_nc_signed.exe与3DMigoto Loader.exe都能成功启动,但是倒计时结束后,unlockfps_nc_signed.exe进程无法被杀死。

@Zebra2711
Copy link

Try this

@echo off

@if not defined USER for /f "tokens=2" %%s in ('whoami /user /fo list') do set "USER=%%s">nul
@set "_=set USER=%USER%&&call "%~f0" %*"&reg query HKU\S-1-5-19>nul 2>nul||(
@powershell -nop -c "start -verb RunAs cmd -args '/d/x/q/r',$env:_"&exit)

start "" "F:\tmp\unlockfps_nc_signed.exe"
start /w "" "full\path\of\3DMmigoto Loader.exe"
taskkill /f /im unlockfps_nc_signed.exe

@635660902
Copy link
Author

Try this

@echo off

@if not defined USER for /f "tokens=2" %%s in ('whoami /user /fo list') do set "USER=%%s">nul
@set "_=set USER=%USER%&&call "%~f0" %*"&reg query HKU\S-1-5-19>nul 2>nul||(
@powershell -nop -c "start -verb RunAs cmd -args '/d/x/q/r',$env:_"&exit)

start "" "F:\tmp\unlockfps_nc_signed.exe"
start /w "" "full\path\of\3DMmigoto Loader.exe"
taskkill /f /im unlockfps_nc_signed.exe

我尝试使用管理员和非管理员运行了,G:\3dmigoto\3DMigoto Loader.exe会报以下错误

------------------------------- 3DMigoto GIMI Loader ------------------------------

The Loader is not configured correctly. Please copy the 3DMigoto d3d11.dll
and d3dx.ini into this directory, then edit the d3dx.ini's [Loader] section
to set the target executable and 3DMigoto module name.

Unable to open d3dx.ini

Press enter to close...

@635660902
Copy link
Author

Try this

@echo off

@if not defined USER for /f "tokens=2" %%s in ('whoami /user /fo list') do set "USER=%%s">nul
@set "_=set USER=%USER%&&call "%~f0" %*"&reg query HKU\S-1-5-19>nul 2>nul||(
@powershell -nop -c "start -verb RunAs cmd -args '/d/x/q/r',$env:_"&exit)

start "" "F:\tmp\unlockfps_nc_signed.exe"
start /w "" "full\path\of\3DMmigoto Loader.exe"
taskkill /f /im unlockfps_nc_signed.exe

我尝试使用管理员和非管理员运行了,G:\3dmigoto\3DMigoto Loader.exe会报以下错误

------------------------------- 3DMigoto GIMI Loader ------------------------------

The Loader is not configured correctly. Please copy the 3DMigoto d3d11.dll and d3dx.ini into this directory, then edit the d3dx.ini's [Loader] section to set the target executable and 3DMigoto module name.

Unable to open d3dx.ini

Press enter to close...

这是我执行的bat脚本
@echo off

@if not defined USER for /f "tokens=2" %%s in ('whoami /user /fo list') do set "USER=%%s">nul
@set "=set USER=%USER%&&call "%~f0" %*"&reg query HKU\S-1-5-19>nul 2>nul||(
@PowerShell -nop -c "start -verb RunAs cmd -args '/d/x/q/r',$env:
"&exit)

start "" "G:\unlockfps\unlockfps_nc_signed.exe"
start /w "" "G:\3dmigoto\3DMigoto Loader.exe"
taskkill /f /im unlockfps_nc_signed.exe

@635660902
Copy link
Author

Try this

@echo off

@if not defined USER for /f "tokens=2" %%s in ('whoami /user /fo list') do set "USER=%%s">nul
@set "_=set USER=%USER%&&call "%~f0" %*"&reg query HKU\S-1-5-19>nul 2>nul||(
@powershell -nop -c "start -verb RunAs cmd -args '/d/x/q/r',$env:_"&exit)

start "" "F:\tmp\unlockfps_nc_signed.exe"
start /w "" "full\path\of\3DMmigoto Loader.exe"
taskkill /f /im unlockfps_nc_signed.exe

问题解决了,直到我看了这个贴子SilentNightSound/GI-Model-Importer#320
3DMigoto Loader.exe可以通过修改配置文件实现启动3DMigoto Loader.exe的同时启动unlockfps_nc_signed.exe,并且unlockfps_nc_signed.exe在游戏退出时也能自动关闭。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants