1

I'm trying to run a query across the network to find something within the user profile section however the I have a problem with the script below:

@echo off
set file=c:\temp\computerlist.txt
for /f "Tokens=*" %%g in (%file%) do (
echo %%g>> c:\regquery.txt
reg query "\\%%g\hku" /s /f remotepath >> c:\temp\regquery.txt
echo.>> c:\temp\regquery.txt
echo.>> c:\temp\regquery.txt
)

Although the script works well it takes forever due to the amount of data in the HKU section so I need to narrow it down further however the next section below HKU is the users SID which is of course unique. It doesn't allow me to run a wildcard such as S-1-5* that would cut out most of the sections.

Can anyone assist me in making this script more efficient as its taking about 30 minutes a computer at the moment!

1 Answer 1

0

Not exactly an amazing fix for the issue but in the end I split up the Computerlist.txt to a number of lists with smaller chunks in and split the regquery.txt results to match the name of the multiple computer lists so I knew where I was with each one.

This meant rather than take 2 hours a machine with 6 running I got 6 results in 2 hours, etc.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .