This will explain, it opens 2 instances of notepad, the 1st the explorer way, the 2nd just notepad, then the 2nd half of the code looks at the instances of notepad and explorer and shows the corresponding process ID's. It can be seen that the Explorer opened version is coupled to Windows Explorer as a process, and the 2nd Notepad as a process
Sub Shell_Example()
Dim o1 As Long
Dim o2 As Long
'From Shell Help
'Runs an executable program and returns a Variant (Double) representing the
'program's task ID if successful, otherwise it returns zero.
o1 = Shell("Explorer.exe ""C:\Windows\system32\notepad.exe""", vbNormalFocus)
o2 = Shell("Notepad.exe")
Debug.Print "Via Explorer : " & o1 & " - Via Notepad : " & o2
Dim objServices As Object, objProcessSet As Object, Process As Object
Set objServices = GetObject("winmgmts:\\" _
& "." & "\root\CIMV2")
Set objProcessSet = objServices.ExecQuery _
("Select Name, ProcessID FROM Win32_Process", , 48)
For Each Process In objProcessSet
If Process.Name Like "*notepad.exe" Or Process.Name Like "*explorer.exe" Then _
Debug.Print Process.Name, Process.ProcessID
Next
End Sub
My Results
Via Explorer : 9932 - Via Notepad : 3776
My Processes
explorer.exe 5240
notepad.exe 4820
notepad.exe 7092
notepad.exe 1492
notepad.exe 11296
explorer.exe 2616
notepad.exe 1276
**explorer.exe 9932**
**notepad.exe 3776**
explorer.exe 11552
Hope this helps.