Delphi Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
델파이 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
FreePascal/Lazarus
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
델마당
볼랜드포럼 광고 모집

델파이 Q&A
Delphi Programming Q&A
[15771] ShellExecuteEx 명령어에서 lpr 명령어가 먹지 않을 때
예성곤 [skyinmine] 1914 읽음    2016-08-31 00:48
특정 명령어가 먹지 않습니다.


    ExecuteFile   := 'c:\Canon_SW\20160830\Temp_RUN.bat';   // 실행할 프로그램
    ParamString   := ' '; //'c:\winzip.log'; // 프로그램의 명령행 파라미터
    StartInString := ' '; //'c:\';           // 시작 위치
    FillChar(SEInfo, SizeOf(SEInfo), 0);
    SEInfo.cbSize := SizeOf(TShellExecuteInfo);

    with SEInfo do
    begin
      fMask        := SEE_MASK_NOCLOSEPROCESS;
      Wnd          := Application.Handle;
      lpFile       := PChar(ExecuteFile);
      lpParameters := PChar(ParamString);
      lpDirectory  := PChar(StartInString);
      nShow        := SW_SHOWNORMAL;
    end;
    if ShellExecuteEx(@SEInfo) then
    begin
      repeat
        Application.ProcessMessages;
        GetExitCodeProcess(SEInfo.hProcess, ExitCode);
      until (ExitCode <> STILL_ACTIVE) or Application.Terminated;
      ShowMessage('프로그램이 종료되었습니다');
    end
    else ShowMessage('프로그램을 실행할 수 없습니다');
===============================================================

아주 간단한 실행구문입니다.
그런데 배치파일에 lpr.exe가 들어있습니다.

lpr -S 192.168.0.8 -P ea3 c:\spool\48435.1608_a3.dat

그런데 그냥 도스창에서는 lpr 명령이 잘 먹습니다.
그런데 프로그램에서 실행시키면 'lpr'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로글앰 , 또는 배치 파일이 아닙니다 라는 메시지가 나타납니다.

환경변수 Path에도 System32 가 잘 들어가 있고 ...
일반 도스창에서 그냥 잘 실행됩니다.

유독 프로그램에서만 안되는군요.








+ -

관련 글 리스트
15771 ShellExecuteEx 명령어에서 lpr 명령어가 먹지 않을 때 예성곤 1914 2016/08/31
15773     Re:ShellExecuteEx 명령어에서 lpr 명령어가 먹지 않을 때 kylix 1871 2016/08/31
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.