How to execute two commands in the Windows registry from the right click context menu Unicorn...
Is Diceware more secure than a long passphrase?
What is the term for a person whose job is to place products on shelves in stores?
Why did Israel vote against lifting the American embargo on Cuba?
Can you stand up from being prone using Skirmisher outside of your turn?
Co-worker works way more than he should
Could Neutrino technically as side-effect, incentivize centralization of the bitcoin network?
Is there any hidden 'W' sound after 'comment' in : Comment est-elle?
What is this word supposed to be?
How would this chord from "Rocket Man" be analyzed?
What *exactly* is electrical current, voltage, and resistance?
What is it called when you ride around on your front wheel?
Retract an already submitted recommendation letter (written for an undergrad student)
Could moose/elk survive in the Amazon forest?
Does Mathematica have an implementation of the Poisson Binomial Distribution?
Is a 5 watt UHF/VHF handheld considered QRP?
What is the least dense liquid under normal conditions?
Second order approximation of the loss function (Deep learning book, 7.33)
Is Bran literally the world's memory?
Seek and ye shall find
Error: Syntax error. Missing ')' for CASE Statement
Where did Arya get these scars?
Did the Roman Empire have penal colonies?
How to get even lighting when using flash for group photos near wall?
Justification for leaving new position after a short time
How to execute two commands in the Windows registry from the right click context menu
Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar ManaraHow to recover my .xml default icon?Unhide Windows 7 context menu extras permanentlyHow to force Chrome disk cache size and directory location?How do I remove the “Undo” option from Windows' right-click context menu?How to remove “folders” links from Open and Save as dialogues?If command, importing .reg not workingHow to add a program in registry using batch file?How can I add a context menu extension for the root directory?How do I combine multiple java (OpenJDK) buttons into a pile on the taskbar?How to “Open CMD Here as Administrator” in right-click menu, with no elevation prompt. Without changing UAC rules
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I am trying to control Windows Update from the right click context menu. I have registry keys that add and/or remove values in the registry that accomplish this. I can successfully execute a single command.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOTDirectoryBackgroundshellWindows Update]
"SubCommands"="Pause updates;Resume updates;Show or hide updates;Open Windows update"
"icon"="wuapi.dll,-0"
"Position"="Bottom"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updates]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updatescommand]
@="reg import pausewu.reg"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellResume updates]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellResume updatescommand]
@="reg import resumewu.reg"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellShow or hide updates]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellShow or hide updatescommand]
@="cmd /c wushowhide.diagcab"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellOpen Windows update]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellOpen Windows updatecommand]
@="cmd /c start ms-settings:windowsupdate"
I need to execute two commands at the same time, but when I add a second command, neither of the commands will run.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOTDirectoryBackgroundshellWindows Update]
"SubCommands"="Pause updates;Resume updates;Show or hide updates;Open Windows update"
"icon"="wuapi.dll,-0"
"Position"="Bottom"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updates]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updatescommand]
@="reg import pausewu.reg" && echo "cmd /c start ms-settings:windowsupdate"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellResume updates]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellResume updatescommand]
@="reg import resumewu.reg" && echo "cmd /c start ms-settings:windowsupdate"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellShow or hide updates]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellShow or hide updatescommand]
@="reg import resumewu.reg" && echo "cmd /c wushowhide.diagcab"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellOpen Windows update]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellOpen Windows updatecommand]
@="cmd /c start ms-settings:windowsupdate"
windows-registry context-menu command-line-arguments right-click
add a comment |
I am trying to control Windows Update from the right click context menu. I have registry keys that add and/or remove values in the registry that accomplish this. I can successfully execute a single command.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOTDirectoryBackgroundshellWindows Update]
"SubCommands"="Pause updates;Resume updates;Show or hide updates;Open Windows update"
"icon"="wuapi.dll,-0"
"Position"="Bottom"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updates]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updatescommand]
@="reg import pausewu.reg"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellResume updates]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellResume updatescommand]
@="reg import resumewu.reg"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellShow or hide updates]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellShow or hide updatescommand]
@="cmd /c wushowhide.diagcab"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellOpen Windows update]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellOpen Windows updatecommand]
@="cmd /c start ms-settings:windowsupdate"
I need to execute two commands at the same time, but when I add a second command, neither of the commands will run.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOTDirectoryBackgroundshellWindows Update]
"SubCommands"="Pause updates;Resume updates;Show or hide updates;Open Windows update"
"icon"="wuapi.dll,-0"
"Position"="Bottom"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updates]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updatescommand]
@="reg import pausewu.reg" && echo "cmd /c start ms-settings:windowsupdate"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellResume updates]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellResume updatescommand]
@="reg import resumewu.reg" && echo "cmd /c start ms-settings:windowsupdate"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellShow or hide updates]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellShow or hide updatescommand]
@="reg import resumewu.reg" && echo "cmd /c wushowhide.diagcab"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellOpen Windows update]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellOpen Windows updatecommand]
@="cmd /c start ms-settings:windowsupdate"
windows-registry context-menu command-line-arguments right-click
What you want isn't possible. You might be able to configure the context menu to run a custom script, which would run the command you want, that's the only possible way I can think to do what you want.
– Ramhound
15 hours ago
add a comment |
I am trying to control Windows Update from the right click context menu. I have registry keys that add and/or remove values in the registry that accomplish this. I can successfully execute a single command.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOTDirectoryBackgroundshellWindows Update]
"SubCommands"="Pause updates;Resume updates;Show or hide updates;Open Windows update"
"icon"="wuapi.dll,-0"
"Position"="Bottom"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updates]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updatescommand]
@="reg import pausewu.reg"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellResume updates]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellResume updatescommand]
@="reg import resumewu.reg"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellShow or hide updates]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellShow or hide updatescommand]
@="cmd /c wushowhide.diagcab"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellOpen Windows update]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellOpen Windows updatecommand]
@="cmd /c start ms-settings:windowsupdate"
I need to execute two commands at the same time, but when I add a second command, neither of the commands will run.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOTDirectoryBackgroundshellWindows Update]
"SubCommands"="Pause updates;Resume updates;Show or hide updates;Open Windows update"
"icon"="wuapi.dll,-0"
"Position"="Bottom"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updates]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updatescommand]
@="reg import pausewu.reg" && echo "cmd /c start ms-settings:windowsupdate"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellResume updates]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellResume updatescommand]
@="reg import resumewu.reg" && echo "cmd /c start ms-settings:windowsupdate"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellShow or hide updates]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellShow or hide updatescommand]
@="reg import resumewu.reg" && echo "cmd /c wushowhide.diagcab"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellOpen Windows update]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellOpen Windows updatecommand]
@="cmd /c start ms-settings:windowsupdate"
windows-registry context-menu command-line-arguments right-click
I am trying to control Windows Update from the right click context menu. I have registry keys that add and/or remove values in the registry that accomplish this. I can successfully execute a single command.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOTDirectoryBackgroundshellWindows Update]
"SubCommands"="Pause updates;Resume updates;Show or hide updates;Open Windows update"
"icon"="wuapi.dll,-0"
"Position"="Bottom"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updates]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updatescommand]
@="reg import pausewu.reg"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellResume updates]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellResume updatescommand]
@="reg import resumewu.reg"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellShow or hide updates]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellShow or hide updatescommand]
@="cmd /c wushowhide.diagcab"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellOpen Windows update]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellOpen Windows updatecommand]
@="cmd /c start ms-settings:windowsupdate"
I need to execute two commands at the same time, but when I add a second command, neither of the commands will run.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOTDirectoryBackgroundshellWindows Update]
"SubCommands"="Pause updates;Resume updates;Show or hide updates;Open Windows update"
"icon"="wuapi.dll,-0"
"Position"="Bottom"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updates]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updatescommand]
@="reg import pausewu.reg" && echo "cmd /c start ms-settings:windowsupdate"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellResume updates]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellResume updatescommand]
@="reg import resumewu.reg" && echo "cmd /c start ms-settings:windowsupdate"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellShow or hide updates]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellShow or hide updatescommand]
@="reg import resumewu.reg" && echo "cmd /c wushowhide.diagcab"
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellOpen Windows update]
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellOpen Windows updatecommand]
@="cmd /c start ms-settings:windowsupdate"
windows-registry context-menu command-line-arguments right-click
windows-registry context-menu command-line-arguments right-click
edited 15 hours ago
freddie-o
asked 16 hours ago
freddie-ofreddie-o
234
234
What you want isn't possible. You might be able to configure the context menu to run a custom script, which would run the command you want, that's the only possible way I can think to do what you want.
– Ramhound
15 hours ago
add a comment |
What you want isn't possible. You might be able to configure the context menu to run a custom script, which would run the command you want, that's the only possible way I can think to do what you want.
– Ramhound
15 hours ago
What you want isn't possible. You might be able to configure the context menu to run a custom script, which would run the command you want, that's the only possible way I can think to do what you want.
– Ramhound
15 hours ago
What you want isn't possible. You might be able to configure the context menu to run a custom script, which would run the command you want, that's the only possible way I can think to do what you want.
– Ramhound
15 hours ago
add a comment |
1 Answer
1
active
oldest
votes
This is technically possible, but is probably not the best way to do this.
How
In order to run multiple commands, they need to be "single line" commands. The sequence of commands must be able to run in one line in the command prompt. That means they need to be contained within the quotes ("
) after @=
.
A good way to test this is by copying everything between the "
and pasting it into the Run dialog.
This will work:
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updatescommand]
@="cmd /c reg import pausewu.reg && start ms-settings:windowsupdate"
Note: Any quotation marks or backslashes used in commands will need to be escaped ("
, \
).
A better way
A better alternative is to create batch files and run those instead. Create a file (ex: pause.bat
) containing your commands:
@ECHO off
reg import pausewu.reg
start ms-settings:windowsupdate
Then use the following in your .reg
file:
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updatescommand]
@="cmd /c "C:\your\path\pause.bat""
Note: Again, any quotation marks or backslashes used in commands will need to be escaped ("
, \
).
Why that's better
This approach is better for a number of reasons:
- You only need to run your
.reg
file once and can make modifications to your batch files as you see fit. The less you edit the registry manually the better. - If you want to add more commands or commands that require any fancy features, this is the only way.
- Making a mistake in the batch file won't break the registry. Making a mistake in the registry can cause huge headaches.
- You can make easy backups of your batch files if you're testing something.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
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%2fsuperuser.com%2fquestions%2f1429083%2fhow-to-execute-two-commands-in-the-windows-registry-from-the-right-click-context%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
This is technically possible, but is probably not the best way to do this.
How
In order to run multiple commands, they need to be "single line" commands. The sequence of commands must be able to run in one line in the command prompt. That means they need to be contained within the quotes ("
) after @=
.
A good way to test this is by copying everything between the "
and pasting it into the Run dialog.
This will work:
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updatescommand]
@="cmd /c reg import pausewu.reg && start ms-settings:windowsupdate"
Note: Any quotation marks or backslashes used in commands will need to be escaped ("
, \
).
A better way
A better alternative is to create batch files and run those instead. Create a file (ex: pause.bat
) containing your commands:
@ECHO off
reg import pausewu.reg
start ms-settings:windowsupdate
Then use the following in your .reg
file:
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updatescommand]
@="cmd /c "C:\your\path\pause.bat""
Note: Again, any quotation marks or backslashes used in commands will need to be escaped ("
, \
).
Why that's better
This approach is better for a number of reasons:
- You only need to run your
.reg
file once and can make modifications to your batch files as you see fit. The less you edit the registry manually the better. - If you want to add more commands or commands that require any fancy features, this is the only way.
- Making a mistake in the batch file won't break the registry. Making a mistake in the registry can cause huge headaches.
- You can make easy backups of your batch files if you're testing something.
add a comment |
This is technically possible, but is probably not the best way to do this.
How
In order to run multiple commands, they need to be "single line" commands. The sequence of commands must be able to run in one line in the command prompt. That means they need to be contained within the quotes ("
) after @=
.
A good way to test this is by copying everything between the "
and pasting it into the Run dialog.
This will work:
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updatescommand]
@="cmd /c reg import pausewu.reg && start ms-settings:windowsupdate"
Note: Any quotation marks or backslashes used in commands will need to be escaped ("
, \
).
A better way
A better alternative is to create batch files and run those instead. Create a file (ex: pause.bat
) containing your commands:
@ECHO off
reg import pausewu.reg
start ms-settings:windowsupdate
Then use the following in your .reg
file:
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updatescommand]
@="cmd /c "C:\your\path\pause.bat""
Note: Again, any quotation marks or backslashes used in commands will need to be escaped ("
, \
).
Why that's better
This approach is better for a number of reasons:
- You only need to run your
.reg
file once and can make modifications to your batch files as you see fit. The less you edit the registry manually the better. - If you want to add more commands or commands that require any fancy features, this is the only way.
- Making a mistake in the batch file won't break the registry. Making a mistake in the registry can cause huge headaches.
- You can make easy backups of your batch files if you're testing something.
add a comment |
This is technically possible, but is probably not the best way to do this.
How
In order to run multiple commands, they need to be "single line" commands. The sequence of commands must be able to run in one line in the command prompt. That means they need to be contained within the quotes ("
) after @=
.
A good way to test this is by copying everything between the "
and pasting it into the Run dialog.
This will work:
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updatescommand]
@="cmd /c reg import pausewu.reg && start ms-settings:windowsupdate"
Note: Any quotation marks or backslashes used in commands will need to be escaped ("
, \
).
A better way
A better alternative is to create batch files and run those instead. Create a file (ex: pause.bat
) containing your commands:
@ECHO off
reg import pausewu.reg
start ms-settings:windowsupdate
Then use the following in your .reg
file:
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updatescommand]
@="cmd /c "C:\your\path\pause.bat""
Note: Again, any quotation marks or backslashes used in commands will need to be escaped ("
, \
).
Why that's better
This approach is better for a number of reasons:
- You only need to run your
.reg
file once and can make modifications to your batch files as you see fit. The less you edit the registry manually the better. - If you want to add more commands or commands that require any fancy features, this is the only way.
- Making a mistake in the batch file won't break the registry. Making a mistake in the registry can cause huge headaches.
- You can make easy backups of your batch files if you're testing something.
This is technically possible, but is probably not the best way to do this.
How
In order to run multiple commands, they need to be "single line" commands. The sequence of commands must be able to run in one line in the command prompt. That means they need to be contained within the quotes ("
) after @=
.
A good way to test this is by copying everything between the "
and pasting it into the Run dialog.
This will work:
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updatescommand]
@="cmd /c reg import pausewu.reg && start ms-settings:windowsupdate"
Note: Any quotation marks or backslashes used in commands will need to be escaped ("
, \
).
A better way
A better alternative is to create batch files and run those instead. Create a file (ex: pause.bat
) containing your commands:
@ECHO off
reg import pausewu.reg
start ms-settings:windowsupdate
Then use the following in your .reg
file:
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerCommandStoreshellPause updatescommand]
@="cmd /c "C:\your\path\pause.bat""
Note: Again, any quotation marks or backslashes used in commands will need to be escaped ("
, \
).
Why that's better
This approach is better for a number of reasons:
- You only need to run your
.reg
file once and can make modifications to your batch files as you see fit. The less you edit the registry manually the better. - If you want to add more commands or commands that require any fancy features, this is the only way.
- Making a mistake in the batch file won't break the registry. Making a mistake in the registry can cause huge headaches.
- You can make easy backups of your batch files if you're testing something.
answered 6 hours ago
WorthwelleWorthwelle
2,85931325
2,85931325
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- 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%2fsuperuser.com%2fquestions%2f1429083%2fhow-to-execute-two-commands-in-the-windows-registry-from-the-right-click-context%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
What you want isn't possible. You might be able to configure the context menu to run a custom script, which would run the command you want, that's the only possible way I can think to do what you want.
– Ramhound
15 hours ago