Windows Registry – I accidentally changed the default value of HKEY_CLASSES_ROOT

I accidentally changed the default value of HKEY_CLASSES_ROOT, which means that I clicked on the default file of HKEY_CLASSES_ROOT and changed its value to "exefile", now, when I tried to ############################################################################################### Open an .exe file. the file simply says that you need a new application to open this exe file. Anyone can help? I can not restore my computer and I should have taken the initial value. I was supposed to go into the EXE folder instead of just changing the default value of HKEY_CLASSES_ROOT … any one can it help me?

Command Line – How to format the HKEY_CLASSES_ROOT shell entries to execute a scheduled task from the right-click context menu?

I'll start by saying that I'm relatively new to the registry changes, but please, support me.


Today, I was having fun with my Windows 10 (1803 family version) and after some research on Google, I did 2 things:

I've made some adjustments / additions to the registry to add the option "Open CMD here as an administrator" to the context menu.
It worked perfectly and here are the changes / additions to the registry:


HKEY_CLASSES_ROOT Directory shell OpenElevatedCmd:

(Default) = Open the command prompt here as an administrator
Icon = cmd.exe

HKEY_CLASSES_ROOT Directory shell OpenElevatedCmd command:

(Default value) = PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList & # 39; / s, / k, pushd,% V -Verb RunAs"

HKEY_CLASSES_ROOT Directory Background shell OpenElevatedCmd:

(Default) = Open the command prompt here as an administrator

Icon = cmd.exe

HKEY_CLASSES_ROOT Directory Background shell OpenElevatedCmd command:

(Default value) = PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList & # 39; / s, / k, pushd,% V -Verb RunAs"

HKEY_CLASSES_ROOT Drive shell OpenElevatedCmd:

(Default) = Open the command prompt here as an administrator

Icon = cmd.exe

HKEY_CLASSES_ROOT Drive shell OpenElevatedCmd command:

(Default value) = PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList & # 39; / s, / k, pushd,% V -Verb RunAs"

HKEY_CLASSES_ROOT FileFile background shell OpenElevatedCmd:

(Default) = Open the command prompt here as an administrator

Icon = cmd.exe

HKEY_CLASSES_ROOT LibraryFolder background shell OpenElevatedCmd command:

(Default value) = (undefined value)


The second thing I did was to use the task scheduler to create a task that runs an admin prompt without the stupid popup window of the user account control and
makes a shortcut to plug it into my taskbar. It worked perfectly as planned. Here is the task I did:

Planned CMD Task High, General

CMD Scheduled Task Action High

The shortcut target for performing this task is as follows: C: Windows System32 schtasks.exe / run / tn "High CMD"


All this was disappointing when I tried to release it and do something that I could not find on Google.

I thought it would be a good idea to make sure that when I launched the admin prompt from the context menu of
folder UAC prompt does not appear. My first thought was to use some sort of method so that the admin prompt did not
request the UAC popup, so I did some research on Google and the only method I could find was the one that used the
"Application Compatibility Toolbox". I tried this method and it did not work, so my next thought was to combine the scheduled task
hint with the registry changes that add the context option "run cmd here as admin". To do this, I had to understand
than put for the new values ​​in the "commands" by default. So I took the arguments of the working values ​​that added the
admin cmd in the context menu (/ s / k pushd% V), and I tested them with the help of a command based on the values ​​of the work register
in PowerShell to see if they did what I thought they did:

"Boot Process cmd.exe & # 39; / s / k pushd% V & # 39;"

This resulted in the opening of a new admin prompt with the message "The system can not find
the specified path. "I assumed it was what should have happened depending on how I think these arguments work.

Then I created a new scheduled task called "ecmd" identical to the "CMD high" task that runs the admin command without
the UAC invites annoying, but this time I added the arguments "/ s / k pushd% Vin the "Add arguments (optional):" field.
I then tested the following in PowerShell:

"Startup process schtasks.exe & # 39; / run / tn ecmd & # 39;"

The new arguments "/ run / tn ecmd" are the same arguments used to launch this task with a shortcut.
This command worked exactly as expected. She opened a new command prompt from the administrator without displaying the UAC window with the same message "Can not
find the specified path "as my previous test.

At this point, I thought I could go, so I changed:

"PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList & # 39; / s, / k, pushd,% V -Verb RunAs""

at:

"PowerShell -windowstyle hidden -Command "Starting the process schtasks.exe -ArgumentList" / run, / tn, ecmd -Verb RunAs ""

In all relevant locations, replace cmd with schtasks and substitute original arguments for arguments that would make
the task scheduler runs the "ecmd" task …

It is there that I became completely lost. All that happens when I open the context menu by right-clicking and selecting "Open Command Prompt"
here as an administrator ", I get a brief overview of the command window and nothing else.

I've also tried these commands:

"PowerShell -windowstyle hidden -Command "Starting the process schtasks.exe -ArgumentList" / run, / tn, ecmd -Verb RunAs ""

"PowerShell -windowstyle hidden -Command "Starting the process schtasks.exe -ArgumentList" / run, / tn, ecmd -Verb Open ""

"PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList & # 39; / run, / tn, ecmd -Verb RunAs ""

"PowerShell -windowstyle hidden -Command "Starting the process schtasks.exe -ArgumentList" / run, / tn, ecmd """

"PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList" / run, / tn, "ecmd" -Verb RunAs ""

"PowerShell -windowstyle hidden -Command "Starting the process schtasks.exe -ArgumentList" / run, / tn, "ecmd" -Verb RunAs ""

"PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList" / run, / tn "ecmd" -Verb RunAs ""

"PowerShell -windowstyle hidden -Command "Starting the process schtasks.exe -ArgumentList" / run, / tn "ecmd" -Verb RunAs ""

"PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList" / run, / tn "ecmd" -Verb RunAs ""

"PowerShell -windowstyle hidden -Command "Starting the process schtasks.exe -ArgumentList" / run, / tn "ecmd" -Verb RunAs ""

Anyone who produces the same results or a theme will open a UAC prompt explaining how to run the task scheduler and the prompt will list schtasks.exe.
with the arguments that I used "/ run" "/ tn" and "ecmd" as the location.

I am completely short of ideas and I would like to know how to format these commands for this to work. I'm not familiar enough to say this with confidence, but I also feel that being able to run a task in 2 clicks from anywhere in explorer / desktop / library will be of great use. in the future when new needs arise.