Batch file Can';t使用;暂停“;在函数中,如果;调用;与插入符号一起用于分割参数
在windows 10上,我无法在.bat文件中使用此功能。控制台打开并退出,跳过暂停功能Batch file Can';t使用;暂停“;在函数中,如果;调用;与插入符号一起用于分割参数,batch-file,Batch File,在windows 10上,我无法在.bat文件中使用此功能。控制台打开并退出,跳过暂停功能 @echo off :: SETLOCAL EnableExtensions EnableDelayedExpansion echo. call :test "param1",<nul ^ "param2",<nul ^ "param3",<nul ^ "param4" exit :test cls echo "%~1" echo "%~2" echo "%~3" echo "
@echo off
:: SETLOCAL EnableExtensions EnableDelayedExpansion
echo.
call :test "param1",<nul ^
"param2",<nul ^
"param3",<nul ^
"param4"
exit
:test
cls
echo "%~1"
echo "%~2"
echo "%~3"
echo "%~4"
echo.
echo This pause doesn't work with caret to split parameters ↓
pause
exit /b
@echo关闭
::SETLOCAL EnableExtensions EnableDelayedExpansion
回声。
调用:测试“param1”,
数字句柄:
STDIN = 0 Keyboard input
STDOUT = 1 Text output
STDERR = 2 Error text output
UNDEFINED = 3-9
数字句柄:
STDIN = 0 Keyboard input
STDOUT = 1 Text output
STDERR = 2 Error text output
UNDEFINED = 3-9
当您添加当您添加时,您的意思是^@jeb在退出之前有暂停
,因此后一个脚本显示按任意键继续代码>两次。你是说^@jeb在退出之前有暂停
,所以后一个脚本显示按任意键继续代码>两次。
call :test "param1","param2","param3","param4" 0<nul
command < filename Type a text file and pass the text to command
STDIN = 0 Keyboard input
STDOUT = 1 Text output
STDERR = 2 Error text output
UNDEFINED = 3-9
call :test "param1" ^
"param2" ^
"param3" ^
"param4"
call :test "param1" 2>nul ^
"param2" 2>nul ^
"param3" 2>nul ^
"param4"