HKU
\\<host>\HKU\<SID>\Software\Microsoft\Windows\CurrentVersion\Run /s
Example:
for /f "delims=\ tokens=2,*" %t in ('reg query HKU') do reg query HKU\%t \Software\Microsoft\Windows\CurrentVersion\Run /s
HKLM
reg query \\<host>\HKLM\Software\Microsoft\Windows\CurrentVersion\Run /s
Example:
FOR /F %i in (hosts.txt) DO @echo [+] %i &&
@reg query HKLM\Software\Microsoft\Windows\CurrentVersion\Run /s 2>NUL > output.txt &&
FOR /F %n in (strings.txt) DO @type output.txt | findstr %n > NUL &&
echo [!] %n was found on %i!
Here are some examples that we have came up with at the office. But trying to figure out how to add in a psexec command to allow for us to query remote computers on the network.
So it would read the hosts from the hosts.txt file along with the strings from the strings.txt and possible add in a variable to change out the different registry keys. Then output it all into one text file.
Do you think this is too much to try in a batch file? What about a powershell script? Thanks