因此,我正在编写一个脚本,该脚本将使用我输入的设置启动一个程序。唯一的问题是,某些凭据更改非常迅速,我只想将所有凭据定义为文本文件,而不必手动将其放入在每次。
@Echo off
set /p Server= What Server would you like? (Input server here.)
set Faction=new
set DelayTime=20000
set Config=minecraftclient.ini
CD C:\minecraft\%Faction%
REM start first 150/100/50
START MinecraftClient.exe %Config% User Pass %Server%
PING 1.1.1.1 -n 1 -w %DelayTime% >NUL
START MinecraftClient.exe %Config% User Pass %Server%
PING 1.1.1.1 -n 1 -w %DelayTime% >NUL
这是脚本的示例。我是从单独的.txt文件中提取“用户”和“通过”的,其中所有用户/通过行都在其中。无论如何,要让它读完每一行并像现在这样运行它,直到完成文件为止?我的批处理不是很好,如果我不能很好地解释它的话,对不起。该文件将被格式化为User:Pass,或者我可以删除冒号(:),然后在文件中将其设为User Pass,如下所示:testuser:testpass或testuser testpass
之后 CD
for /f %%a in (userpass.txt) do (
START MinecraftClient.exe %Config% %%a %%b %Server%
PING 1.1.1.1 -n 1 -w %DelayTime% >NUL
)
假设文件userpass.txt
包含
username1 password1
username2 password2
username3 password3
username4 password4
如果您想保留结肠,那么
for /f "delims=:" %%a in (userpass.txt) do (
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句