@echo off REM Collect-Dsregcmd.cmd REM READ-ONLY. Runs "dsregcmd /status" as the person who double-clicked it, saves the result REM on their Desktop and also copies it to the clipboard. It changes nothing on the laptop. REM Run it as the affected user in a NORMAL window (not "Run as administrator"). REM Then paste or drop the file into the dsregcmd Reader page. setlocal net session >nul 2>&1 if %errorlevel%==0 ( echo WARNING: this window is running as administrator. echo The user-specific lines in the result may be wrong. echo Close it and double-click the file again WITHOUT "Run as administrator". echo. ) set "OUT=%USERPROFILE%\Desktop\dsregcmd-%COMPUTERNAME%.txt" > "%OUT%" echo Collected on %COMPUTERNAME% by %USERNAME% >> "%OUT%" echo. dsregcmd /status >> "%OUT%" clip < "%OUT%" echo Saved to: %OUT% echo The same text is now on your clipboard. Paste it into the dsregcmd Reader. echo. pause