Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Registry Windows

3 Weeks Ago   #1
Underthaker

Windows 10 Pro x64
 
 
Registry Windows

Hello everyone, I would like to know in Batch File Script, if it is possible to find registry keys in the following location that I leave here below:

HKLM \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ EditionID

To tell me which edition of Windows is installed.
Thanks to anyone who can give me the copy Batch script, thank you.


My System SpecsSystem Spec
.
3 Weeks Ago   #2
iko22

Windows 7 x64, Vista x64, 8.1 smartphone
 
 

Hello Underthaker

There is no need to touch the registry to find the Windows Edition. Try any of the several commands from Option 5 see which windows 10 edition you have installed.
My System SpecsSystem Spec
3 Weeks Ago   #3
SIW2

Microsoft Community Contributor Award Recipient

Vista x64 / 7 X64
 
 

Code:
@echo off

For /f "tokens=3*" %%G in ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "EditionID" ^|Find "REG_"') do Call Set _THISEDITION=%%G%%H

Echo %_THISEDITION%

pause
My System SpecsSystem Spec
.

3 Weeks Ago   #4
Underthaker

Windows 10 Pro x64
 
 

Thank you for your help. But I would like to get the Batch command in which if the edition is X perform an action on specifies. Using the command if it exists? I do not know if I understand.

That is, if it is the Pro edition, it executes the A action.
If the Home edition is running the B action.
If the Enterprise edition is running the C action.

It was something I wanted in a Script batch file.
My System SpecsSystem Spec
3 Weeks Ago   #5
SIW2

Microsoft Community Contributor Award Recipient

Vista x64 / 7 X64
 
 

It is the same as I posted above:
@echo off

For /f "tokens=3*" %%G in ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "EditionID" ^|Find "REG_"') do Call Set THISEDITION=%%G%%H

IF %THISEDITION% EQU Professional (
some command here to execute the A action
) ELSE (
some other command to execute action B
)

rem or you could do this

IF %THISEDITION% EQU Enterprise (
some command here to execute the C action
)

pause
rem or you can use not equal to NEQ

IF %THISEDITION% NEQ Enterprise (
echo Sorry this is not Entereprise, cannot do whatever
echo Press any to key to exit
pause >nul
exit
)

rem or if it not enterprise, go to some other part of the batch

IF %THISEDITION% NEQ Enterprise GOTO :SOMEOTHERBIT
My System SpecsSystem Spec
3 Weeks Ago   #6
Underthaker

Windows 10 Pro x64
 
 

Quote   Quote: Originally Posted by SIW2 View Post
It is the same as I posted above:
@echo off

For /f "tokens=3*" %%G in ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "EditionID" ^|Find "REG_"') do Call Set THISEDITION=%%G%%H

IF %THISEDITION% EQU Professional (
some command here to execute the A action
) ELSE (
some other command to execute action B
)

IF %THISEDITION% EQU Enterprise (
some command here to execute the C action
)

pause
Thanks mate, that's what I was looking for. A good act
My System SpecsSystem Spec
3 Weeks Ago   #7
SIW2

Microsoft Community Contributor Award Recipient

Vista x64 / 7 X64
 
 

What you posted will perform
some command here to execute the A action ...if it is Professional
or
some command here to execute the B action ...if it is not Professional
then it would also perform
some command here to execute the C action ...if it is Enterprise

Those were just examples of different ways to use IF and EQU and NEQ


To keep it simple

Code:
@echo off

For /f "tokens=3*" %%G in ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "EditionID" ^|Find "REG_"') do Call Set THISEDITION=%%G%%H

IF %THISEDITION% EQU Professional (
some command here to execute the A action
) 

IF %THISEDITION% EQU Ultimate (
some command here to execute the B action
) 


IF %THISEDITION% EQU Enterprise (
some command here to execute the C action
and if you want another command here to perform E action
and if you want another command here to perform F action
)
My System SpecsSystem Spec
3 Weeks Ago   #8
Underthaker

Windows 10 Pro x64
 
 

And what will be the batch script to detect in the (CurrentBuildNumber) registry?
My System SpecsSystem Spec
3 Weeks Ago   #9
SIW2

Microsoft Community Contributor Award Recipient

Vista x64 / 7 X64
 
 

Try and work it out, now you have had an example.
My System SpecsSystem Spec
3 Weeks Ago   #10
Underthaker

Windows 10 Pro x64
 
 

Quote   Quote: Originally Posted by SIW2 View Post
Try and work it out, now you have had an example.
Yes, but what do I put in "IF% THISEDITION%", "IF% CurrentBuildNumber%"?
My System SpecsSystem Spec
Reply

 Registry Windows




Thread Tools




Similar help and support threads
Thread Forum
Cannot delete certain Registry Key; Cannot change Owner of Registry Ke
In order to get rid of the *.zip folder view in WinExplorer on a64bit WIn7 system I tried to delete (according to some tutorials) the Registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{E88DCCE0-B7B3-11d1-A9F0-00AA0060FA31} Unfortuantely this is NOT possible immediately....
General Discussion
Registry: can't control Desktop Background Slideshow in registry?
Just a rough test: 1. No slideshow on desktop; 2. Backup the registry file; 3. Turn on the slideshow (Desktop - Personalize - Desktop Background - Select All - Save Changes); 4. Run the backup registry file; The desktop starts with the original picture (the desktop wallpaper picture...
Customization
Registry problem after windows update and registry optimization tool
Hello sevenforum, I've already spend some time on this forum today but I can't find the solution to a particular registry problem I'm having. While windows was uploading some updates yesterday, I cleaned my registry using Iolo's system mechanic tool and that's where the problems started. (I...
Backup and Restore
Driver Sweeper can't delete all registry files in registry editor
http://i2.aijaa.com/b/00227/9175142.png So this is the situation: I've unistalled Amd Driver from Device Manager, Unistalled Catalyst software and ran Driver Sweeper. There is only 3 registeries that the Driver Sweeper CAN'T delete and these are under SYSTEM\ folder. I've tried to change user...
Drivers


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 00:34.
Twitter Facebook