Reason Analysis:
Because under our system Windows folders (c:windows) and the System32 folder (C:windowssystem32) there is a Notepad.exe program, the system in the registration application and file association open way, use them separately, but open the way to read these two places, so there are two notepad.
Workaround:
1, first create a batch, to deal with this problem, the inside of the code copy paste to a text file, save as a suffix. bat file, execute on it.
@echo off
If exist "%systemroot%notepad.exe" set npath= "%systemroot%notepad.exe%" 1
If not exist "%systemroot%notepad.exe" set npath= "%systemroot%system32notepad.exe%" 1
REG ADD "Hkcrtxtfileshellopencommand"/ve/d%npath%/t reg_sz/f
REG ADD "Hkcrapplicationsnotepad.exeshellopencommand"/ve/d%npath%/t reg_sz/f
REG ADD "Hkcrsystemfileassociationstextshellopencommand"/ve/d%npath%/t reg_sz/f
2, then you can resolve the right key to choose to open the way to appear two Notepad options.
Simple Introduction to the command:
If exist "%systemroot%notepad.exe" set npath= "%systemroot%notepad.exe%" 1
This sentence is set to a variable: npath= "%systemroot%notepad.exe%" 1, this variable will be written to the registry.
%1 represents a parameter
For example, you want to open 1.txt, is to use the command: Notepad 1.txt to fix.
This method is solved the txt suffix file open way to appear two folder problem.
Summarize:
When we set the TXT suffix to open the type,
Set the Hkey_classes_rootsystemfileassociationstextshellopencommand=%systemroot%notepad.exe
This causes the text type to be mapped directly to the C:windowsnotepad.exe
All Perceivedtype=text file types, including the INI file INF file, are mapped to C:windowsnotepad.exe.
The open type of the Ini,inf file has been mapped to the C:windowssystem32notepad.exe
Right-click to open---Two notepad options are available ...
The fundamental way to solve this problem is to Hkey_classes_rootsystemfileassociationstextshellopencommand=%systemroot%system32notepad.exe
Please use the command:
@echo off
Set npath= "%systemroot%system32notepad.exe%" 1
REG ADD "Hkcrtxtfileshellopencommand"/ve/d%npath%/t reg_sz/f
REG ADD "Hkcrapplicationsnotepad.exeshellopencommand"/ve/d%npath%/t reg_sz/f
REG ADD "Hkcrsystemfileassociationstextshellopencommand"/ve/d%npath%/t reg_sz/f
Finally, let's look at the so-called INI file: