'net stop spooler' fails with exit code 259

北城余情 提交于 2019-12-24 08:58:55

问题


I launch 'net stop spooler' using CreateProcess from my C++ program. It fails and the exit code is 259.

Anyone know what that error code means? Also if someone can give me a link to some documentation about the possible error codes for this command and their meanings I'd much appreciate it.


回答1:


259 is not an error rather its STILL_ACTIVE which GetExitCodeProcess returns if the process handle you pass it relates to a process that has not terminated (and so has no exit code).

If you want to wait for it to exit before getting the exit code, call WaitForSingleObject() on the process handle.



来源:https://stackoverflow.com/questions/12175430/net-stop-spooler-fails-with-exit-code-259

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!