The working is simple. shell_exec() function will act as Run in start menu in windows. If we enter the location of a file in Run, it will open the file.
We use several commands in run to open applications like mspaint, notepad, gpedit.msc etc. All these commands can also be given inside shell_exec().