I recently ran into an issue when trying to use the Run Command Line step during a SCCM 2012 R2 SP1 task sequence on a VMware Virtual Machine.
This step worked fine on both physical hardware and on a Hyper-V Virtual Machine. However, on a VMware Virtual Machine, the task sequence returned the following error: Incorrect Function (0x00000001). After some additional troubleshooting I found that VMware tools appeared to be the culprit here. I moved VMware Tools install to the very last step in my Task Sequence and then everything worked correctly.
Some more information: I found that if I changed commands that I was trying to run, it wouldn’t always fail. It appeared the issue only consistently occurred when I used the Run As option in the Run Command Line step. For example, I was using sqlcmd.exe to make changes to a SQL Server, which SYSTEM does not have access to do, so Run As was required. The only solution I could find was to just make sure that VMware Tools isn’t installed until all other steps are finished in the Task Sequence.