don't overengineer it :-)
getOwnProcessId = getObject("winmgmts:\.\root\cimv2").ExecQuery("Select * From Win32_Process Where ProcessId=" & createObject("wscript.shell").Exec("rundll32").ProcessID).itemIndex(0).ParentProcessId
if oWShell and oWMI is already defined in your script:
getOwnProcessId = oWMI.ExecQuery("Select * From Win32_Process Where ProcessId=" & oWShell("rundll32").ProcessID).itemIndex(0).ParentProcessId
No need to actively terminate your temporarily created child-process:
rundll32 just terminates if called without parameter, but the exec-object is still properly initiated with the parentId information