Advertisement
Merzavets

Get Windows version from cmd and do something

Apr 19th, 2012
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. for /f "tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName ^| find "ProductName"') do set ProductName=%%b
  2.  
  3. if "%ProductName%" == "Microsoft Windows XP" goto Win_XP
  4. if "%ProductName%" == "Windows 7 Ultimate" goto Win_7
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement