내 질문을 해결하고 다음 C 코드를 컴파일하고 exe 출력을 runjob.exe로 명명 한 다음 hook bat 파일에서 runjob another_prog를 사용하는 방법을 찾았습니다. 이제는 ok입니다.
당신은 하이브리드 배치/JScript의 파일을 만들 수 있습니다
#include <windows.h>
#include <stdio.h>
#include <tchar.h>
int _tmain()
{
char * pCmd = ::GetCommandLine();
// skip the executable
if (*pCmd++ == L'"')
{
while (*pCmd++ != L'"');
}
else
{
while (*pCmd != NULL && *pCmd != L' ')
++pCmd;
}
while (*pCmd == L' ')
pCmd++;
STARTUPINFO si;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
PROCESS_INFORMATION pi;
ZeroMemory(&pi, sizeof(pi));
// Start the child process.
BOOL result = CreateProcess
(
NULL, // No module name (use command line)
pCmd, // Command line
NULL, // Process handle not inheritable
NULL, // Thread handle not inheritable
FALSE, // Set bInheritHandles to FALSE
DETACHED_PROCESS, // Detach process
NULL, // Use parent's environment block
NULL, // Use parent's starting directory
&si, // Pointer to STARTUPINFO structure
&pi // Pointer to PROCESS_INFORMATION structure (returned)
);
if (result) return 0;
char msg[2048];
FormatMessage
(
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
::GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT),
msg, sizeof(msg),
NULL
);
fputs(msg, stderr);
_flushall();
return -1;
}
당신에게 수 해결하려는 문제를 분명히하십시오. Subversion 커밋 후크가 모든 프로세스가 종료 될 때까지 기다리는 것이 사실입니까? 왜 'start cmd/c startWebLogic.cmd'가 작동하지 않습니까? – Cheeso
시작 cmd/c는 SVN 포스트 커밋 훅이 훅을 기다릴 것이고 훅 출구가 생성 한 ** 자식 프로세스 ** 때문에 작동하지 않습니다. 그것은 SVN의 디자인입니다. 나는 해결책을 찾았습니다. http://svn.haxx.se/users/archive-2008-11/0301.shtml – zhongshu