Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 如何由批处理文件用户编辑环境变量的长值,而无需输入所有内容?_Batch File - Fatal编程技术网

Batch file 如何由批处理文件用户编辑环境变量的长值,而无需输入所有内容?

Batch file 如何由批处理文件用户编辑环境变量的长值,而无需输入所有内容?,batch-file,Batch File,如果我只想更改字符串中的几个字符,是否可以不重新键入整个字符串变量 set "var=This is a very long string up to 200 characters..... etc . etc....." set /p "var=var? " 我必须全部重打 我需要下面的东西 Output var=This is a very long string up to 200 characters..... etc . etc..... and using left and ri

如果我只想更改字符串中的几个字符,是否可以不重新键入整个字符串变量

set "var=This is a very long string up to 200 characters..... etc . etc....."
set /p "var=var? "
我必须全部重打

我需要下面的东西

Output
var=This is a very long string up to 200 characters..... etc . etc..... 
and using left and right arrows to change it. Enter when done.   

下面是一个批处理JScript混合脚本,可以执行您想要的操作:

@if (@CodeSection == @Batch) @then

@echo off
set "var=This is a very long string up to 200 characters..... etc . etc....."
CScript //nologo //E:JScript "%~F0" "%var%"
set /P "var=var? "
echo var=%var%
goto :EOF

@end

WScript.CreateObject("WScript.Shell").SendKeys(WScript.Arguments(0));

有一些解决方法,但我们必须知道如何输入字符串以及如何使用批处理文件
Aacini
编写了一个VBS增强脚本,可以在您提到IIRC的方式上帮助您,但我不记得它是发布在这里还是在Dostips.com论坛上。@foxidrive:这是链接: