Put the Windows OS Name into a DOS environment variable from the command line.

Posted on 2008-11-17
Last Modified: 2013-12-05
I want to put Put the Windows "OS Name" into a DOS environment veriable from the command line (in a batch file).
Question by:PeterSinger
    1 Comment
    LVL 95

    Accepted Solution

    First, you know there is a basic version variable in %os%, right?

    Second, you can use a command like this:
    for /f "tokens=* delims=" %%a in ('ver') do @set osversion=%%a

    The above command will assign the output of the command ver to the varible %osversion%

    If this is not what you are looking for, please try to be more specific.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Are your corporate email signatures appalling?

    Is it scary how unprofessional your email signatures look? Do users create their own terrible designs and give themselves stupid job titles? You can make this a lot easier for yourself by choosing an email signature management solution from Exclaimer today.

    This is my 3rd article on SCCM in recent weeks, the 1st ( dealing with installat…
    Welcome to my series of short tips on migrations. Whilst based on Microsoft migrations the same principles can be applied to any type of migration. My first tip Migration Tip #1 – Source Server Health can be found listed in my profile here: http:…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now