Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find the path of notepad.exe and mspaint.exe

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.)

like image 867
Heng-Cheong Leong Avatar asked Feb 06 '09 07:02

Heng-Cheong Leong


People also ask

Where is notepad.exe location?

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.

What is the path of 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 are notepad files saved Windows 10?

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.

Where are Notepad ++ files saved?

If no cloud location is specified (see above), Notepad++ stores its settings files in %AppData%\Notepad++ , which resides in the user profile.


1 Answers

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.

like image 160
paxdiablo Avatar answered Nov 11 '22 14:11

paxdiablo