From 4501d73134d02aa615d03238ee1ee70d25132f29 Mon Sep 17 00:00:00 2001 From: Nepenthe Date: Mon, 29 Jul 2024 23:32:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DWay05=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=B8=A6=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/BootWay05-utf8.ps1 | 11 +++++++++-- script/BootWay05.ps1 | 12 +++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/script/BootWay05-utf8.ps1 b/script/BootWay05-utf8.ps1 index 281747fb..054c7948 100644 --- a/script/BootWay05-utf8.ps1 +++ b/script/BootWay05-utf8.ps1 @@ -45,7 +45,14 @@ $jsCode | Out-File -FilePath $jsFilePath -Encoding UTF8 Write-Output "JavaScript code has been generated and saved to $jsFilePath" # 设置NAPCAT_PATH环境变量为 当前目录的loadScript.js地址 $env:NAPCAT_PATH = $jsFilePath - +for ($i = 0; $i -lt $args.Length; $i++) { + $param = $args[$i] + if ($args[$i] -eq "-q" -and $i + 1 -lt $args.Length) { + $nextParam = $args[$i + 1] + $params = "$param $nextParam" + break + } +} Try { $QQpath = Get-QQpath } @@ -57,4 +64,4 @@ Catch { } $commandInfo = Get-Command $QQpath -ErrorAction Stop -Start-Process powershell -ArgumentList "-noexit", "-noprofile", "-command &{& chcp 65001;& '$($commandInfo.Path)' --enable-logging }" \ No newline at end of file +Start-Process powershell -ArgumentList "-noexit", "-noprofile", "-command &{& chcp 65001;& '$($commandInfo.Path)' --enable-logging $params}" diff --git a/script/BootWay05.ps1 b/script/BootWay05.ps1 index 1b69d266..01f4e287 100644 --- a/script/BootWay05.ps1 +++ b/script/BootWay05.ps1 @@ -45,8 +45,14 @@ $jsCode | Out-File -FilePath $jsFilePath -Encoding UTF8 Write-Output "JavaScript code has been generated and saved to $jsFilePath" # 设置NAPCAT_PATH环境变量为 当前目录的loadScript.js地址 $env:NAPCAT_PATH = $jsFilePath - -$params = $args -join " " +for ($i = 0; $i -lt $args.Length; $i++) { + $param = $args[$i] + if ($args[$i] -eq "-q" -and $i + 1 -lt $args.Length) { + $nextParam = $args[$i + 1] + $params = "$param $nextParam" + break + } +} Try { $QQpath = Get-QQpath } @@ -58,4 +64,4 @@ Catch { } $commandInfo = Get-Command $QQpath -ErrorAction Stop -Start-Process powershell -ArgumentList "-noexit", "-noprofile", "-command &{& '$($commandInfo.Path)' --enable-logging $params}" \ No newline at end of file +Start-Process powershell -ArgumentList "-noexit", "-noprofile", "-command &{& '$($commandInfo.Path)' --enable-logging $params}"