1
1
Is there a way to view the environment variables of a specific process. I know that i can see them using the Process Explorer. However, i need to use them in a batch or powershell script. Is there a command that does that. Can I use the procexp.exe of the Process explorer to get this information to use it in a following script?
Not sure I can speak to "of a specific process" (session variables), but if you want to see all the environmental variables (just System and User I thought) you can use: (Get-WMIObject -Class "Win32_Environment") – Dallas – 2018-01-18T23:13:45.317
(get-process -id 17512).StartInfo.EnvironmentVariables <<also just appears to pull the same System and User environmental variables – Dallas – 2018-01-18T23:24:42.673