I am making a batch file that can check to see if your office 2013 has a icense or not.
for /f "tokens=3 delims=: " %%a in (
'cscript "%ProgramFiles%Microsoft OfficeOffice15OSPP.VBS" /dstatus ^| find "License Status:"'
) do set "licenseStatus=%%a"
if /i "%licenseStatus%"=="--- LICENSED ---" (
Echo I am Licensed
Pause
EXIT
) Else (
Echo I am NOT Licensed
Pause
EXIT
)
But every time I run this code it all way come back with a I am NOT Licensed. I have check it be running the ospp.vbs script myself it say ---License---. I would like to know where I when wrong with this. Thinking it in the path for this script. I am talking about (%ProgramFiles%Microsoft OfficeOffice15OSPP.VSB /Dstatus) Any help you can give me would like a great help. Thank you for taking the time to read this.
See Question&Answers more detail:os