VBS won't modify registry
I am writing a vbscript that I need to modify several registry entries. The issue is that after Chrome or Firefox is removed from one of our computers you can no longer open links outside of the web browser. This is because the computer is still treating the removed browser as the default. I have several other registry modifications that are working but when I run the script it will not make changes to the following registry keys:
'does not work
strRoot = "HKEY_CLASSES_ROOT\https\Shell\open\command\ddeexec\"
wShell.RegWrite strRoot,"" & Chr(34) & "%1" & Chr(34) & ",,-1,0,,,,"
'does not work
strRoot = "HKEY_CLASSES_ROOT\https\Shell\open\command\ddeexec\NoActivateHandler"
wShell.RegWrite strRoot,""
'does not work
开发者_如何学编程 strRoot = "HKEY_CLASSES_ROOT\https\Shell\open\command\ddeexec\Application\"
wShell.RegWrite strRoot,"IExplore"
'does not work
strRoot = "HKEY_CLASSES_ROOT\https\Shell\open\command\ddeexec\Topic\"
wShell.RegWrite strRoot,"WWW_OpenURL"
This also needs to be applied to the "HTTP" key in the same path and likewise nothing within the "ddeexec" folder can be changed. I don't believe it's a permissions issue however because I can go into regedit and change it manually with no problem
Try
HKEY_CLASSES_ROOT\https\Shell\open\ddeexec\
instead of
HKEY_CLASSES_ROOT\https\Shell\open\command\ddeexec\
Are you running this script locally or remotely? Does the machine have any antivirus running? Which version of Windows are you using?
Registry permissions for script access can be different than that of the local user account. Namely this means that having success changing a registry key with Registry Editor does not necessarily mean that you will be able to do it from a script.
As an aside, opening any remaining browser on this system should prompt the user to make it their default browser. If they choose to allow that, it will reset all of these settings for you.
精彩评论