scripts/htdocs/cgi-bin/printenv.vbs
casjay 9b376b0fd6
🦈🏠🐜 Initial Commit 🐜🦈🏠
2023-04-06 19:28:01 -04:00

18 lines
565 B
Plaintext

'!c:/windows/system32/cscript -nologo
Option Explicit
Dim objShell, objArray, str, envvar, envval
Set objShell = CreateObject("WScript.Shell")
Set objArray = CreateObject("System.Collections.ArrayList")
WScript.StdOut.WriteLine "Content-type: text/plain; charset=iso-8859-1" & vbLF
For Each str In objShell.Environment("PROCESS")
objArray.Add str
Next
objArray.Sort()
For Each str In objArray
envvar = Left(str, InStr(str, "="))
envval = Replace(Mid(str, InStr(str, "=") + 1), vbLF, "\n")
WScript.StdOut.WriteLine envvar & Chr(34) & envval & Chr(34)
Next