代码拉取完成,页面将自动刷新
@echo off
set "args=%*"
set "script_name=%~n0"
setlocal enableDelayedExpansion
REM Check if we have "Quiet" at the end of our name
if /i not "!script_name:~-5!" == "quiet" (
echo This script is intended to be a quiet version of the target
echo script, however its name does not end in "quiet" so the target
echo script cannot be located.
echo.
echo Press [enter] to quit.
endlocal
pause > nul
exit /b
)
set "target_name=!script_name:~0,-5!.bat"
set "target_script=%~dp0!target_name!"
if not exist "%~dp0!target_name!" (
echo Could not find !target_name!.
echo Please make sure to run this script from the same directory
echo as !target_name!.
echo.
echo Press [enter] to quit.
endlocal
pause > nul
exit /b
)
call :launchScript "!target_script!" "args"
endlocal
exit /b
:launchScript <script_path> <args_name>
setlocal enableDelayedExpansion
REM Let's check what our requirements are in order to launch, and
REM adjust as needed
set "_target=%~1"
set "_args=!%~2!"
REM Let's sanitize our args a bit
if not "!_args!" == "" (
call :cleanArg "_args" "true"
)
REM And our target
call :cleanArg "_target"
REM Let's build our command
powershell -c "& {$a=@();foreach($x in $args){foreach($y in (Invoke-Expression('Write-Output -- '+$x-replace'\$',\"`0\"))-replace\"`0\",'$$'){$a+='\"{0}\"'-f$y}};$c=$a-join' ';$d='/c \"{0}\"'-f$c;Start-Process '%COMSPEC:'=''%' -WindowStyle hidden -ArgumentList $d}" '\"!_target!\"!_args!'
endlocal
exit /b
:cleanArg <argname> <prepend_space>
REM Escape some problematic chars for powershell
set "%~1=!%~1:`=``!"
set "%~1=!%~1:'=`''!"
set "%~1=!%~1:"=\"!"
set "%~1=!%~1:(=`(!"
set "%~1=!%~1:)=`)!"
set "%~1=!%~1:{=`{!"
set "%~1=!%~1:}=`}!"
set "%~1=!%~1:$=`0!"
set "%~1=!%~1:;=`;!"
if "%~2" == "" (
set "%~1=!%~1!"
) else (
set "%~1= !%~1!"
)
exit /b
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。