Skip to content

Repository files navigation

pids

simple GoLang app on top of shirou/gopsutil to export variables for all process ancestors of cli

Usage:

  -version             # 1.0.3

  -vars                # Output environment variable assignments for each parent process
                       # batch file example: for /f "delims=" %%v in ('pids.exe -vars') do %%v
                       # then use %PID0%, %ProcessName2%, etc. in your batch file

  -name [-level N]     # Output process name for the Nth parent (default 0 = current process)
                       # batch example: for /f %%v in ('pids.exe -name -level 3') do if "%%v"=="explorer.exe" timeout /t 10

  -pid [-level N]      # Output PID for the Nth parent (default 0 = current process)

-vars output:
-------------
set PID0=17280
set ProcessName0=pids.exe
set PID1=6936
set ProcessName1=cmd.exe
set PID2=28424
set ProcessName2=gsudo.exe
set PID3=34168
set ProcessName3=cmd.exe
set PID4=11280
set ProcessName4=explorer.exe

About

simple GoLang app on top of shirou/gopsutil to export variables for all process ancestors of cli

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages