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

前端 未结 7 573
悲哀的现实
悲哀的现实 2020-12-01 12:46

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-commi

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-01 13:11

    What you can do is create a Scheduled Task that executes the batch script or other executable that runs for a long time. Set it to run once, in the past and don't set it to delete the task when no more runs are scheduled. Then in your Subversion hook script, put the following line in:

    schtasks /run /tn NameOfYourTaskHere
    

    I confirmed with a test by having my scheduled task run Notepad++ and the Notepad++ executable showed up as a child of svchost.exe, not the cmd.exe window that I executed the schtasks command from.

提交回复
热议问题