Batch file 如何使用批处理文件在cmd中执行.exe程序 我想制作一个.BAT文件,它将在命令提示符内打开最近编译的.exe文件(我最近开始学习C++),但是当我运行我的程序时,它会立即打开和关闭我的程序)我希望这个程序运行到编译的.exe的路径,我的书说用2行方法制作一个批处理文件: [Program.exe] [pause]

Batch file 如何使用批处理文件在cmd中执行.exe程序 我想制作一个.BAT文件,它将在命令提示符内打开最近编译的.exe文件(我最近开始学习C++),但是当我运行我的程序时,它会立即打开和关闭我的程序)我希望这个程序运行到编译的.exe的路径,我的书说用2行方法制作一个批处理文件: [Program.exe] [pause],batch-file,cmd,Batch File,Cmd,但是我想创建一个bat文件来打开任何命令提示符程序,然后停止,我到目前为止有这样一个文件: @ echo off echo "input addres of file" set /P file_a=[promptString] echo "opening file %file_a% is this right? [y/N]" set /P input2=[promotString] if (input2)==("n")

但是我想创建一个bat文件来打开任何命令提示符程序,然后停止,我到目前为止有这样一个文件:

    @ echo off
    echo "input addres of file"  
    set /P file_a=[promptString]  
    echo "opening file %file_a% is this right? [y/N]"  
    set /P input2=[promotString]  
    if (input2)==("n")  
    GOTO @ echo off
    if (input2)==("y")  
    call file_a  
    pause      
这不管用,我能在这方面得到任何帮助吗

p、 我相当肯定GOTO声明是错误的,这是未经测试的:

@echo off
:start
set "file_a="
set "input2="
set /P "file_a=input address of file "
set /P "input2=opening file %file_a% is this right? [y/N] "
if /i "%input2%=="n" goto :start  
call "%file_a%"  
pause