It's not funny. If put in KMS key in activate page work, there are no point write a lot of batch file.
KMS key only work with batch file.
When install Windows or Office, come to activation page, close it. After finish installation, run the batch file, done.