jamesas Posted January 16, 2005 Share Posted January 16, 2005 Hey guys i found a post for this but it was for WPI but what i need is the code required to only start the progam if the windows version is 5.2 Link to comment Share on other sites More sharing options...
Dahi Posted January 16, 2005 Share Posted January 16, 2005 Something like this:@echo offver | find "Version 5.2"if errorlevel 1 goto NotVer52echo Version 5.2goto end:NotVer52echo Not Version 5.2goto end:end Link to comment Share on other sites More sharing options...
JuMz Posted May 1, 2008 Share Posted May 1, 2008 Just wanted to post and say thanks for this tip. I knew that 'ver' displayed that information but didn't know how to parse it.Here is what I am using to differentiate between XP and Vista.@echo offver | find "Version 5.1"if errorlevel 1 goto NotXPecho XPgoto end:NotXPver | find "Version 6.0"if errorlevel 1 goto endecho Vistagoto end:endThanks again Link to comment Share on other sites More sharing options...
Sonic Posted May 1, 2008 Share Posted May 1, 2008 (edited) You can use this :if exist %SystemDrive%\bootmgr start "" setup.exeFor me,I use that code, it's check uac too ...if exist %SystemDrive%\bootmgr fsutil | find "administrateur"if exist %SystemDrive%\bootmgr if "%errorlevel%"=="0" echo UAC ON&&pause&&exit else echo UAC OFF&&start "" setup.exe Edited May 1, 2008 by Sonic Link to comment Share on other sites More sharing options...
Yzöwl Posted May 2, 2008 Share Posted May 2, 2008 Hey guys i found a post for this but it was for WPI but what i need is the code required to only start the progam if the windows version is 5.2We really need more information than this, because the way I see it is that if you're creating an unattended disk, you should already know what OS you're installing!ver | find "Version 5.2"ver | find "Version 5.1"This will actually only return the version of the Command Interpreter not the Operating System. Although this is likely to be the same, it is not always true.if exist %SystemDrive%\bootmgrUnfortunately if the OS is part of a Dual Boot system with Vista and XP for instance, the bootmgr directory may exist in the root of the XP system drive thus giving a false case. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now