3

We use a batch file with the following content to activate our windows domain computer after imaging:

slmgr.vbs -ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
slmgr -ato

This works well, but there is a problem: after each command a dialog box appears and the file does not continue until you closed it.

Is there a way to supress the dialog boxes? (on success, not on error). A way so that at least both commands are executed without user intervention would be fine too (it gets boring to walk past 50+ computer and pressing enter on each of them)

4 Answers 4

4

Try 'start slmgr -ato' in your batch file

10

Calling via cscript also works

cscript C:\Windows\System32\slmgr.vbs /ato
1
  • Worked perfectly for me. This should be the accepted answer.
    – beppe9000
    Feb 17, 2022 at 16:12
1

As suggested in this post: https://stackoverflow.com/questions/41423512/batch-file-i-want-to-supress-the-windows-script-host-pop-ups

add '//b' to your command. That suppresses the popup.

e.g.

slmgr.vbs //b -ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
1
  • I like Ritch Melton's solution better because the information is printed to the standard output.
    – beppe9000
    Feb 17, 2022 at 16:11
-1

+1 for the "cscript ..." variant which provides useful ERRORLEVEL on command execution whereas the "add '//b'" variant does not give any ERRORLEVEL on exit.

Kind regards Chris

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .