The shell (or the program that launches the script), calls the CreateProcess()
function. The CreateProcess function has the lpCurrentDirectory
parameter. The shell (or any other program that launches the script), sets the lpCurrentDirectory
parameter implicitly (~not through the parameters of the script).
That parameter is later stored in the undocumented property of the RTL_USER_PROCESS_PARAMETERS
structure. msdnLink, docLink
- note the word: undocumented (that's why I haven't found the info on msdn in the first place).
Related stackoverflow questions: