Win7 the reason and workaround for the two identical Notepad options in the Open by right key

Source: Internet
Author: User
Tags ini

  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:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.