问题
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