Video Screencast Help
Give us your opinion and win with Symantec! Please help us by taking this survey to tell us about your experience with Symantec Connect, so that we can continue to grow and improve.  Take the survey.

After XP OS deployment command "wmic exit" hangs

Created: 03 Jan 2013 • Updated: 07 Jan 2013 | 1 comment

After OS deployment with Altiris I run some batch files one of the batch file has to do some wmic commands and I run:

WMIC EXIT

in order to start the wmic install before executing the commands.

If I deploy with my old setup Remote Installation Services this runs just fine if I deploy with Altiris using deployanywhere it hangs at this command.

Does anyone know why or what I can do about this?

Update:  (moved from deployment solution forum to SMP because this is an issue with the Agent)

I have found that this issue happens because the altiris agent is installed during deployment.  If I stop deployment prevent altiris agent from installing I do not have this problem.  If I uninstall the altiris agent I do not have this problem.  It is not related to any of the plugins as I have tested this also.  This started after MP1 update I believe.

Comments 1 CommentJump to latest comment

jlawson's picture

Ok found the real issue with tons of testing and help from Thomas Baird (Thanks Tom):

ok I take back what I said it is not the agent itself but a line of code I ran before the wmic commands.

This query fails the wmic commands later on:
SC query AeXNSClient | FIND "STATE" | FIND "RUNNING" >> c:\RISlog\Deployment.log 2>&1

When I Uninstalled the agent a precheck for the agent prevents the above command from running. Running the command against a different service produces the same hanging result.  So what we found is it is due to the logging of that command.

remove "2>&1" from the SC command and wmic does not hang later.

So here is test code that fails:

SC query AeXNSClient | FIND "STATE" | FIND "RUNNING" >> c:\RISlog\Deployment.log 2>&1
WMIC EXIT >> c:\RISlog\Deployment.log 2>&1
wmic ComputerSystem Get model >> c:\RISlog\Deployment.log
end

This commands works:

SC query AeXNSClient | FIND "STATE" | FIND "RUNNING" >> c:\RISlog\Deployment.log
WMIC EXIT >> c:\RISlog\Deployment.log 2>&1
wmic ComputerSystem Get model >> c:\RISlog\Deployment.log
end

Hopefully this can help someone else!!!  If anyone has an explanation I would sure be interested!