checking for both service packs is fine too.
Main Topics
Browse All Topicshi all,
I've been fighting a batch file that uninstalls symantec anti virus and installs forefront. the fact that forefront isn't supported by windows XP SP1, it's very important that the script makes sure that the operating system is windows XP SP2 or higher before removing symantec anti virus and then installs forefront.
the scripts should abort if windows XP1 or lower is installed.
I've got the script that will do the work, but for some reason it's not working. the exact part that's not working is this:
Start Script ==========================
for /f "tokens=1-20" %%x in ('reg query "hklm\software\microsoft\w
Rem
if "ProductName" geq "Microsoft Windows XP" goto XP
exit
:XP
cls
Echo This computer is running Microsoft Windows XP
Pause
Rem
for /f "tokens=1-14" %%j in ('reg query "hklm\software\microsoft\w
Rem
if "CSDVERSION" geq "Service Pack 2" goto SP2
exit
:SP2
cls
Echo This computer is running Microsoft Windows XP with Service Pack 2
Pause
End ScriptScript ==========================
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I see a few issues.
1) I don't think you want to set your tokens to 1-20 in your FOR loop. Probably 3-5 or better yet, 2*
2) Not sure why you are starting your variable with x, but you may run past z before you get what you need
3) I don't think you want spaces in your SET command
4) You need to compare to your environment variable which will be surrounded in %
5) Since there are spaces in your comparisons, you should put quotes around them
6) Comparing strings with GEQ in this case is probably not a good idea. Use EQU instead
7) As previously suggested, you should probably check for SP2 or SP3
And similar issues with ProductName and CSDVersion.
Try something like:
GuruGary,
I have couple of questions to ask and it's really not directly related to the original questin I posted.
Thanks again for all your help.
Business Accounts
Answer for Membership
by: OriNetworksPosted on 2009-02-09 at 18:51:36ID: 23596801
Is the computer service pack 3 maybe? maybe you should check for "service pack 2" OR "service pack 3"