Find the path of notepad.exe and mspaint.exe

前端 未结 11 1288
后悔当初
后悔当初 2021-01-31 09:45

What is the best way to find out where notepad.exe and mspaint.exe are that will work across various versions of Windows?

Should I get the Windows directory via SHGetFol

11条回答
  •  没有蜡笔的小新
    2021-01-31 10:11

    Check if the key HKEY_CLASSES_ROOT\Applications\notepad.exe is the same on localized versions. Maybe the key name is same and the value for edit/open points to the localized exe.
    Example:

    English:
    HKEY_CLASSES_ROOT\Applications\notepad.exe\shell\edit\command
    %SystemRoot%\system32**NOTEPAD.EXE** %1

    Dutch:
    HKEY_CLASSES_ROOT\Applications\notepad.exe\shell\edit\command
    %SystemRoot%\system32**kladblok.exe** %1

    If thats the case, then its just about to check the registry for that key (same goes for the mspaint).

提交回复
热议问题