Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to output a window to a text file?

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!

like image 907
user2997654 Avatar asked Mar 06 '14 19:03

user2997654


1 Answers

Use cscript to output text from slmgr to the console.

cscript slmgr.vbs /xpr
like image 89
JonPall Avatar answered Oct 04 '22 21:10

JonPall