Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
254 views
in Technique[技术] by (71.8m points)

Running another program in Windows bat file and not create child process

I have subversion server with a post-commit hook to do something.

I want the checkin finish soon, not wait the hook script. But by design, the Subversion post-commit hook script will run until all child process exit, so using somthing like:

start another_prog...

in the hook bat file has no use.

So I want to know how to run another program in Windows bat file which not create child process or let the child process detach from the parent.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Synchronous. The second notepad won't launch until you close the first.

notepad.exe c:empa.txt
notepad.exe c:emp.txt

Asynchronous: The second notepad will launch even if you haven't closed the first.

start notepad.exe c:empa.txt
start notepad.exe c:emp.txt

More info about the start command:
http://www.robvanderwoude.com/ntstart.php

EDIT: The following comment was made elsewhere by @zhongshu, the original poster. I'm only copying it here:

start cmd /c doesn't work because SVN post-commit hook will wait for the hook and the child process created by the hook exit. It's the design of SVN. I have found a solution, Please refer: http://svn.haxx.se/users/archive-2008-11/0301.shtml

Assuming that he knows what he's talking about, I'm wrong and...undeserving.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...