Get user from Remote PC

Parameter %1 = PC FOR /f "tokens=8 delims=\" %%a in ('reg query "\\%1\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\hivelist" ^| find "UsrClass.dat"') do (    REM %%a contains logged in username  Echo "Repairing User Profile %%a"  )