2013-06-01 2 views
0

최근에 컴파일 된 .exe 파일을 명령 프롬프트에 열어주는 .bat 파일을 만들고 싶습니다. (최근에 C++를 배우기 시작했지만 프로그램을 실행할 때 그것은 열고 내가 경로를 사용하여 실행이 프로그램을 원하는) 즉시 내 프로그램을 종료합니다 내 책이 2 줄 방법을 사용하여 배치 파일을 만들라고 .EXE 컴파일 :배치 파일을 사용하여 cmd 내에서 .exe 프로그램을 실행하는 방법

[Program.exe] 
[pause] 

을하지만 하나를 만들고 싶어 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.s. 나는

답변

0

이 안된있는 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  
관련 문제