Find the path of notepad.exe and mspaint.exe

前端 未结 11 1191
后悔当初
后悔当初 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:17

    Normally, you would just execute them. They are on the system path in every version of Windows.

    You can use ExpandEnvironmentStrings. The environment variable you want to expand is WINDIR.

    In the past you could have used GetWindowsDirectory or GetSystemDirectory, but I think they are deprecated.

提交回复
热议问题