문제

I'm designing a batch file to first check if a copy of windows is activated (using the slmgr /xpr command) and if it isn't input a key to activate it. I have everything done except for the checking for activation as when you run the slmgr /xpr command, it outputs to a windows host script dialogue box and I can't figure out how to have that box output its text into a text file to use as a variable. Does anyone know how to do this/ has a better way? Thanks in advance!

도움이 되었습니까?

해결책

Use cscript to output text from slmgr to the console.

cscript slmgr.vbs /xpr

다른 팁

Try this, you may just change slmgr.vbs /dli to slmgr.vbs /xpr.

It will automatically generate a text file saved to your C:\ drive:

cscript c:\Windows\System32\slmgr.vbs /dli > c:\slmgr_result.txt
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top