Hi there. I wrote for myself a small script, that checks the activation status of the installed MS Office products, but i ran into trouble, for some reason i kept on getting "'cscript' is not recognized as an internal or external command, operable program or batch file.", i figured out that the problem was that it needed admin privilege, but in the meantime i had already created another batch to get to the same results just via a different way, and it worked without Admin privilege, why did the first one require admin privilege and the second one did not? First batch file (requires admin) Code: :10-32 if not exist "C:\Program Files (x86)\Microsoft Office\Office14" ( goto :10-64 ) else ( set "path=C:\Program Files (x86)\Microsoft Office\Office14" ) goto :run :10-64 if not exist "C:\Program Files\Microsoft Office\Office14" ( goto :13-32 ) else ( set "path=C:\Program Files\Microsoft Office\Office14" ) goto :run :13-32 if not exist "C:\Program Files (x86)\Microsoft Office\Office15" ( goto :13-64 ) else ( set "path=C:\Program Files (x86)\Microsoft Office\Office15" ) goto :run :13-64 if not exist "C:\Program Files\Microsoft Office\Office15" ( goto :16-32 ) else ( set "path=C:\Program Files\Microsoft Office\Office15" ) goto :run :16-32 if not exist "C:\Program Files (x86)\Microsoft Office\Office16" ( goto :16-64 ) else ( set "path=C:\Program Files (x86)\Microsoft Office\Office16" ) goto :run :16-64 if not exist "C:\Program Files\Microsoft Office\Office16" ( echo there is no office installed on this system ) else ( set "path=C:\Program Files\Microsoft Office\Office16" ) goto :run :run cscript "%path%"\ospp.vbs /dstatus pause Second batch script (does not require admin) Code: :10-32 cscript "C:\Program Files (x86)\Microsoft Office\Office14"\ospp.vbs /dstatus if errorlevel 1 ( cls goto :10-64 ) pause :10-64 cscript "C:\Program Files\Microsoft Office\Office14"\ospp.vbs /dstatus if errorlevel 1 ( cls goto :13-32 ) pause :13-32 cscript "C:\Program Files (x86)\Microsoft Office\Office15"\ospp.vbs /dstatus if errorlevel 1 ( cls goto :13-64 ) pause :13-64 cscript "C:\Program Files\Microsoft Office\Office15"\ospp.vbs /dstatus if errorlevel 1 ( cls goto :16-32 ) pause :16-32 cscript "C:\Program Files (x86)\Microsoft Office\Office16"\ospp.vbs /dstatus if errorlevel 1 ( cls goto :16-64 ) pause :16-64 cscript "C:\Program Files\Microsoft Office\Office16"\ospp.vbs /dstatus if errorlevel 1 goto :eof pause Whats even more weird, "cscript" doesn't usually need admin rights . Thanks in advance
What happens if you set the name of your variable in the first script something other than an existing environment variable?