Batch file, I want to supress the Windows Script Host Pop-Ups

5.4k views Asked by At

I use the MDT (Microsoft Deployment Toolkit) with WDS (Windows Deployment Services) in my organization. I call a CMD-File with cmd /c %scriptroot%\HP_Win_7.bat within the task sequence.

Content of the batch file:

slmgr /ilc c:\support\zertifikate\HP.xrm-ms
slmgr /ipk 74T2M-DKDBC-788W3-H689G-6P6GT
slmgr /ato

During execution of the batch file I get 3 pop-ups from Windows Script Host which I have to acknowledge by pressing "OK" or "Enter". The Batch pauses, until I acknowledge the pop-up. If not, the cmd-file pauses.

I want a solution to hide those pop-ups or automatically acknowledge them.

The script loads a certificate file and a generic key and activates windows. (The Windows-Key is generic, for HP Win 7 PCs)

1

There are 1 answers

1
MC ND On BEST ANSWER

It depends on who is generating the pop-ups. If they are directly generated by the slmgr.vbs script, then you have two simple options:

  • You can directly request the execution of the script in "batch" mode, and you will get no ouput

    slmgr.vbs //b /ilc c:\support\zertifikate\HP.xrm-ms
    ...
    
  • If you want to keep the output (but no popups from the script), instead of executing the script under wscript.exe (the default, used when you directly invoke the script), use cscript.exe to execute it in console mode, to get all the output written into the console

    cscript.exe //nologo "%systemroot%\system32\slmgr.vbs" /ilc c:\support\zertifikate\HP.xrm-ms
    ...