setting registry keys via batch script; CLSIDs

Tanyac

Reputable
Does anyone know if keys like this: {20D04FE0-3AEA-1069-A2D8-08002B30309D} are constant on each installation of Windows or do they change with each Install?

The default value for mine for this CLSID is "This PC", the default for Windows 10

I've had a few customers ask me to set it to a different value (Eg. My Computer); easy enough to do.... As long the the CLSID is the same every time...
 
Solution
Windows 10 Home 1803 Build 17134.81

A pic of my reg:
reg.jpg

Example batch file:

@echo off
REM Mostly taken from bottom of page here: https://www.computerhope.com/forum/index.php?topic=60342.0

setlocal enabledelayedexpansion

for /f "tokens=2 delims=:" %%i in ('reg query hkcu\Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D} /s') do goto success
goto err

:err
echo Can't find key!
goto END

:success
echo Found key!
goto END

:END
pause

Tanyac

Reputable


Yes. I believe in a 40 year I.T. career I managed to learn a thing or two.

Back on topic - I've checked several PCs at different customers and friends and family. So far, everyone of them has had the same CLSID. Interesting that you are seeing different results.

This is the specific registry key..
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}

Do you have the same CLSID for that key?
 

gardenman

Splendid
Moderator
Windows 10 Home 1803 Build 17134.81

A pic of my reg:
reg.jpg

Example batch file:

@echo off
REM Mostly taken from bottom of page here: https://www.computerhope.com/forum/index.php?topic=60342.0

setlocal enabledelayedexpansion

for /f "tokens=2 delims=:" %%i in ('reg query hkcu\Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D} /s') do goto success
goto err

:err
echo Can't find key!
goto END

:success
echo Found key!
goto END

:END
pause
 
Solution
Well lessee, 2+27+18 = 47 years IT experience for me. I have that CLSID with a value of "value not set". YMMV but I just have to say I shudder when I see folks talking about patching the registry because in my experience these things cause more problems than they cure. Even if they work with whatever you currently have, you never know what the next update can bring. Venturing away from what the majority have is a good way to get a visit from Murphy in my experience.
 

Tanyac

Reputable


That's fine. Not set will result in "This PC" being used for File Explorer. I wasn't so much concerned what value you have for the key, just that the CLSID existed.

47 Years IT. Gee, I thought I was antique. Good to know there's some veterans here :)

I'm aware of the risks of changing group policies and registry settings. I'm also aware of Microsoft's "couldn't care less about customers/users" attitude. It's a risk I'm prepared to take.

Which is why I posted here. Doing my due diligence before making changes.

Setting the default value to "My Computer" simply changes what you see on File Explorer. Which was the goal. This can easily be achieved by simply right clicking "This PC" and selecting Rename. I just wanted to automate the task for customers who have already requested the change so when I upgrade their systems I can spend less time doing manual stuff, and more time doing meaningful stuff.