Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Issue with .CMD file returning Error 1

Our Imaging company provided a .CMD script due to some of our Windows 11 machines being inactivated.

Whenever I attempt to deploy it via PDQ (as a CMD step or an install), it fails with error code 1. If I run the .CMD file elevated on the machine it works. 

Potentially relevant info:

1.Domain environment, deploy user is Domain Admin

2.Local Administrator account is active (Not sure if this is at all relevant)

Any assistance would be appreciated. Below is the script in question


for /f "tokens=2 delims==" %%B in ('wmic path softwarelicensingservice get OA3xOriginalProductKey /value ^| find "="') do set "key=%%B"

cscript.exe //b slmgr.vbs /ipk %key%
cscript.exe //b slmgr.vbs /ato


Date Votes
  • Does it work if you set the run mode to Deploy User (Interactive) from the Options tab of the package?

  • It does not, the result is the same.

  • Is there anything in the Output Log?

  • No, there isn't even an Output Log shown

  • This might be a path issue. Try adding the following to the top of your script:

    CD \Windows\System32
  • You sir, are a saint. That remedied the issue. Thank you!