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 SHGetFolderPath(NULL, CSIDL_WINDOWS, NULL, SHGFP_TYPE_CURRENT, dir)
, and then traverse through all the subdirectories to look for the two files?
(Assume that I am not interested in anything outside the Windows folder.)
Both Windows 11 and Windows 10 store an executable file for Notepad in the default Windows folder. This means that you can use File Explorer to navigate to your Windows folder and double-click on the notepad.exe file to open Notepad.
Notepad.exe is located in the C:\Windows\System32 folder. Known file sizes on Windows 10/8/7/XP are 179,712 bytes (40% of all occurrences), 69,120 bytes and 18 more variants. Notepad.exe is a Windows system file. The program has a visible window.
Where Notepad files are saved in Windows 10/11? On the Windows operating system, the default storage location for Notepad files is: C:\Users\Username\AppData\Roaming.
If no cloud location is specified (see above), Notepad++ stores its settings files in %AppData%\Notepad++ , which resides in the user profile.
This works on every Windows box I've got access to (XP+).
c:\> for %i in (cmd.exe) do @echo %~$PATH:i C:\WINDOWS\system32\cmd.exe c:\> for %i in (python.exe) do @echo %~$PATH:i C:\Python25\python.exe
The great thing is, you don't have to use the actual %PATH%
, you can substitute your own search path by using a different environment variable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With