VBscript ,writing into registry Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!How to read a registry value whose name is a file path using WshShell.RegReadWhy might the .NET framework (V2.0) be trying to mess with the Internet Explorer registry?C# Access 64 bit RegistryC# getting status of SystemRestore from the registryBatch File Registry searchHow to find Office 2013 installation path programmatically?Cannot read registry key when using SRVANYAccess related error using QTP while modifying registry settingsget windows startup program infoUser specific software not getting registered in proper location in registry
macOS: Name for app shortcut screen found by pinching with thumb and three fingers
Do I really need to have a message in a novel to appeal to readers?
What is an "asse" in Elizabethan English?
Crossing US/Canada Border for less than 24 hours
How were pictures turned from film to a big picture in a picture frame before digital scanning?
Strange behavior of Object.defineProperty() in JavaScript
Tannaka duality for semisimple groups
Can the Flaming Sphere spell be rammed into multiple Tiny creatures that are in the same 5-foot square?
How would a mousetrap for use in space work?
How can I set the aperture on my DSLR when it's attached to a telescope instead of a lens?
What does this say in Elvish?
Converted a Scalar function to a TVF function for parallel execution-Still running in Serial mode
Getting prompted for verification code but where do I put it in?
Why are my pictures showing a dark band on one edge?
How did Fremen produce and carry enough thumpers to use Sandworms as de facto Ubers?
What is the meaning of 'breadth' in breadth first search?
What would you call this weird metallic apparatus that allows you to lift people?
Semigroups with no morphisms between them
How much damage would a cupful of neutron star matter do to the Earth?
Most bit efficient text communication method?
Why do aircraft stall warning systems use angle-of-attack vanes rather than detecting airflow separation directly?
Would it be easier to apply for a UK visa if there is a host family to sponsor for you in going there?
How could we fake a moon landing now?
Drawing spherical mirrors
VBscript ,writing into registry
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!How to read a registry value whose name is a file path using WshShell.RegReadWhy might the .NET framework (V2.0) be trying to mess with the Internet Explorer registry?C# Access 64 bit RegistryC# getting status of SystemRestore from the registryBatch File Registry searchHow to find Office 2013 installation path programmatically?Cannot read registry key when using SRVANYAccess related error using QTP while modifying registry settingsget windows startup program infoUser specific software not getting registered in proper location in registry
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am having trouble modifying Registry key values,
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite "HKCUMyNewKeyMyValue", "0"
WshShell.RegWrite "HKLMSOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystemEnableLUA","0"
when i execute the code it always gave an error, 'Invalid Root in Registry'
whats wrong with the code could somebody explain this ?
windows vbscript registry
add a comment |
I am having trouble modifying Registry key values,
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite "HKCUMyNewKeyMyValue", "0"
WshShell.RegWrite "HKLMSOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystemEnableLUA","0"
when i execute the code it always gave an error, 'Invalid Root in Registry'
whats wrong with the code could somebody explain this ?
windows vbscript registry
2
Access to HKLM is restricted to administrators, tried running it as such?
– Alex K.
Mar 30 '12 at 15:32
I am running that code as an administrator already
– Sufiyan Ghori
Mar 30 '12 at 15:45
1
msdn.microsoft.com/en-us/library/c72z3kxt%28v=VS.85%29.aspx
– Hans Passant
Mar 30 '12 at 15:50
add a comment |
I am having trouble modifying Registry key values,
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite "HKCUMyNewKeyMyValue", "0"
WshShell.RegWrite "HKLMSOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystemEnableLUA","0"
when i execute the code it always gave an error, 'Invalid Root in Registry'
whats wrong with the code could somebody explain this ?
windows vbscript registry
I am having trouble modifying Registry key values,
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite "HKCUMyNewKeyMyValue", "0"
WshShell.RegWrite "HKLMSOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystemEnableLUA","0"
when i execute the code it always gave an error, 'Invalid Root in Registry'
whats wrong with the code could somebody explain this ?
windows vbscript registry
windows vbscript registry
asked Mar 30 '12 at 15:21
Sufiyan GhoriSufiyan Ghori
11.8k95783
11.8k95783
2
Access to HKLM is restricted to administrators, tried running it as such?
– Alex K.
Mar 30 '12 at 15:32
I am running that code as an administrator already
– Sufiyan Ghori
Mar 30 '12 at 15:45
1
msdn.microsoft.com/en-us/library/c72z3kxt%28v=VS.85%29.aspx
– Hans Passant
Mar 30 '12 at 15:50
add a comment |
2
Access to HKLM is restricted to administrators, tried running it as such?
– Alex K.
Mar 30 '12 at 15:32
I am running that code as an administrator already
– Sufiyan Ghori
Mar 30 '12 at 15:45
1
msdn.microsoft.com/en-us/library/c72z3kxt%28v=VS.85%29.aspx
– Hans Passant
Mar 30 '12 at 15:50
2
2
Access to HKLM is restricted to administrators, tried running it as such?
– Alex K.
Mar 30 '12 at 15:32
Access to HKLM is restricted to administrators, tried running it as such?
– Alex K.
Mar 30 '12 at 15:32
I am running that code as an administrator already
– Sufiyan Ghori
Mar 30 '12 at 15:45
I am running that code as an administrator already
– Sufiyan Ghori
Mar 30 '12 at 15:45
1
1
msdn.microsoft.com/en-us/library/c72z3kxt%28v=VS.85%29.aspx
– Hans Passant
Mar 30 '12 at 15:50
msdn.microsoft.com/en-us/library/c72z3kxt%28v=VS.85%29.aspx
– Hans Passant
Mar 30 '12 at 15:50
add a comment |
1 Answer
1
active
oldest
votes
Try "HKEY_LOCAL_MACHINE" instead of HKLM. "HKEY_CURRENT_USER" instead of HKCU...
As stated in the documentation "You may use abbreviated versions of root key names with theRegWrite
method. The five root keys are listed in the following table."HKLM
is one of those abbreviations, this answer is nonsense.
– Lankymart
Mar 22 at 13:08
Doesn't work: Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.RegWrite "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystemEnableLUA","0" It states --------------------------- Line: 2 Char: 1 Error: Invalid root in registry key "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystemEnableLUA". Code: 80070005 Source: WshShell.RegWrite
– Thompson
Mar 22 at 17:57
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f9945878%2fvbscript-writing-into-registry%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try "HKEY_LOCAL_MACHINE" instead of HKLM. "HKEY_CURRENT_USER" instead of HKCU...
As stated in the documentation "You may use abbreviated versions of root key names with theRegWrite
method. The five root keys are listed in the following table."HKLM
is one of those abbreviations, this answer is nonsense.
– Lankymart
Mar 22 at 13:08
Doesn't work: Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.RegWrite "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystemEnableLUA","0" It states --------------------------- Line: 2 Char: 1 Error: Invalid root in registry key "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystemEnableLUA". Code: 80070005 Source: WshShell.RegWrite
– Thompson
Mar 22 at 17:57
add a comment |
Try "HKEY_LOCAL_MACHINE" instead of HKLM. "HKEY_CURRENT_USER" instead of HKCU...
As stated in the documentation "You may use abbreviated versions of root key names with theRegWrite
method. The five root keys are listed in the following table."HKLM
is one of those abbreviations, this answer is nonsense.
– Lankymart
Mar 22 at 13:08
Doesn't work: Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.RegWrite "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystemEnableLUA","0" It states --------------------------- Line: 2 Char: 1 Error: Invalid root in registry key "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystemEnableLUA". Code: 80070005 Source: WshShell.RegWrite
– Thompson
Mar 22 at 17:57
add a comment |
Try "HKEY_LOCAL_MACHINE" instead of HKLM. "HKEY_CURRENT_USER" instead of HKCU...
Try "HKEY_LOCAL_MACHINE" instead of HKLM. "HKEY_CURRENT_USER" instead of HKCU...
answered Mar 30 '12 at 15:56
Nathan RiceNathan Rice
2,91111627
2,91111627
As stated in the documentation "You may use abbreviated versions of root key names with theRegWrite
method. The five root keys are listed in the following table."HKLM
is one of those abbreviations, this answer is nonsense.
– Lankymart
Mar 22 at 13:08
Doesn't work: Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.RegWrite "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystemEnableLUA","0" It states --------------------------- Line: 2 Char: 1 Error: Invalid root in registry key "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystemEnableLUA". Code: 80070005 Source: WshShell.RegWrite
– Thompson
Mar 22 at 17:57
add a comment |
As stated in the documentation "You may use abbreviated versions of root key names with theRegWrite
method. The five root keys are listed in the following table."HKLM
is one of those abbreviations, this answer is nonsense.
– Lankymart
Mar 22 at 13:08
Doesn't work: Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.RegWrite "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystemEnableLUA","0" It states --------------------------- Line: 2 Char: 1 Error: Invalid root in registry key "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystemEnableLUA". Code: 80070005 Source: WshShell.RegWrite
– Thompson
Mar 22 at 17:57
As stated in the documentation "You may use abbreviated versions of root key names with the
RegWrite
method. The five root keys are listed in the following table." HKLM
is one of those abbreviations, this answer is nonsense.– Lankymart
Mar 22 at 13:08
As stated in the documentation "You may use abbreviated versions of root key names with the
RegWrite
method. The five root keys are listed in the following table." HKLM
is one of those abbreviations, this answer is nonsense.– Lankymart
Mar 22 at 13:08
Doesn't work: Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.RegWrite "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystemEnableLUA","0" It states --------------------------- Line: 2 Char: 1 Error: Invalid root in registry key "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystemEnableLUA". Code: 80070005 Source: WshShell.RegWrite
– Thompson
Mar 22 at 17:57
Doesn't work: Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.RegWrite "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystemEnableLUA","0" It states --------------------------- Line: 2 Char: 1 Error: Invalid root in registry key "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystemEnableLUA". Code: 80070005 Source: WshShell.RegWrite
– Thompson
Mar 22 at 17:57
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f9945878%2fvbscript-writing-into-registry%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Access to HKLM is restricted to administrators, tried running it as such?
– Alex K.
Mar 30 '12 at 15:32
I am running that code as an administrator already
– Sufiyan Ghori
Mar 30 '12 at 15:45
1
msdn.microsoft.com/en-us/library/c72z3kxt%28v=VS.85%29.aspx
– Hans Passant
Mar 30 '12 at 15:50