how to scan a windows registry's all user profiles and fetch the value of ProxyEnable and proxy server using REG query

生来就可爱ヽ(ⅴ<●) 提交于 2020-06-17 14:54:16

问题


Please tell me how to search each profile of HKEY_USERS and find the value of ProxyEnable and proxy server.

I have a Nodejs binary(.exe) which basically runs in individual machines. I use Procrun(commons.apache.org/proper/commons-daemon/procrun.html) to run my Nodejs application as a service. and the Nodejs application tries to find the proxy config through child process which runs this reg query. Due to some other limitation of application its always fetching the details from the default profile "Computer\HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Internet Settings" because it is running under the default profile(User). So the idea is just to scan all profiles(Users) under HKEY_USERS and fetch ProxyEnable and proxy server details. It would be great if you suggest a way to accomplish this.

I use the below script 
FOR /F " skip=2 tokens=1-3" %%A IN ('reg query "HKEY_USERS" /v ProxyEnable 2^>nul') DO (
  @echo %KEY_NAME%\%VALUE_NAME% not found
    set ValueName=%%A
    set ValueType=%%B
    set ValueValue=%%C
)

It's not returning the values. My expectation is it should scan all folders under HKEY_USERS and get all the values of ProxyEnable key.

Thanks

来源:https://stackoverflow.com/questions/60831718/how-to-scan-a-windows-registrys-all-user-profiles-and-fetch-the-value-of-proxye

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!