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
1

Comments

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

    1
  • It does not, the result is the same.

    1
  • Is there anything in the Output Log?

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

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

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

    0

Please sign in to leave a comment.

Didn't find what you were looking for?

New post