This is the code command I have but it only loops indefinitely.
SET X=%username%
gpresult /h c:%X%.html /user %X%
@ echo off