Win7 right "open mode" has two identical notepad options for reasons and solutions

  
            
Reason analysis:
Because there is a notepad.exe program in our system windows folder (C:\\Windows) and system32 folder (C:\\Windows\\System32), the system is registering applications and files. When the association is opened, they are used separately, but the open method has to read these two places, so two notebooks appear.
Solution:
1, first create a batch, used to deal with this problem, copy and paste the code inside to a text file, save as a suffix .bat file, you can do it.
@echo off
if exist & ldquo; set Npath = & ldquo;;%% \\ notepad.exe & rdquo systemroot% systemroot% \\ notepad.exe% & rdquo; 1
if not exist & ldquo;% systemroot% \\ notepad .exe & rdquo; set Npath = & ldquo;% systemroot% \\ system32 \\ notepad.exe% & rdquo; 1
reg add & ldquo; HKCR \\ txtfile \\ shell \\ open \\ command & rdquo; /ve /d% Npath% /t REG_SZ /f
reg add & ldquo; HKCR \\ Applications \\ notepad.exe \\ shell \\ open \\ command & rdquo; /ve /d% Npath% /t REG_SZ /f
reg add & ldquo; HKCR \\ SystemFileAssociations \\ text \\ shell \\ open \\ Command” /ve /d %Npath% /t REG_SZ /f
2. Then you can solve the two notepad options in the right-click mode.
Command brief introduction:
If exist “%systemroot%\ otepad.exe” set Npath=“%systemroot%\ otepad.exe %”1
This sentence is to set a variable: Npath =“%systemroot%\ otepad.exe %”1, this variable will be written to the registry.
%1 means parameter
For example, if you want to open 1.txt, you can use the command: notepad 1.txt.
This method solves the problem that two folders appear in the txt suffix file open mode.
Summary:
When we set the txt suffix open type,
set HKEY_CLASSES_ROOT\\SystemFileAssociations\\text\\shell\\open\\command=%systemroot%\ otepad.exe
This causes the text type Map directly to c:\\Windows\ otepad.exe
At this time, all PerceivedType=text file types including the ini file inf file are mapped to c:\\Windows\ otepad.exe.
ini, the open type of inf file has been mapped to c:\\Windows\\System32\ otepad.exe
At this time, the right button will open---two notebook options will appear. .
The fundamental solution is to use HKEY_CLASSES_ROOT\\SystemFileAssociations\\text\\shell\\open\\command=%systemroot%\\System32\ otepad.exe
Please use the command:
@echo off
set Npath = & ldquo;% systemroot% \\ system32 \\ notepad.exe% & rdquo; 1
reg add & ldquo; HKCR \\ txtfile \\ shell \\ open \\ command & rdquo; /ve /d% Npath% /t REG_SZ /f
reg add & ldquo; HKCR \\ Applications \\ notepad.exe \\ shell \\ open \\ command & rdquo; /ve /d% Npath% /t REG_SZ /f
reg add & ldquo; HKCR \\ SystemFileAssociations \\ text \\ shell \\ open \\ command & rdquo; /ve /d %Npath% /t REG_SZ /f
Finally, let's take a look at the so-called ini file:

Copyright © Windows knowledge All Rights Reserved