echo ==================================================================
echo USB Information:
echo.>>%COMPUTERNAME%.txt
echo USB Information:>>%COMPUTERNAME%.txt
for /f "skip=4 tokens=2*" %%a in ('reg query "HKLMSYSTEMCurrentControlSetServicesusbstor" /v "start" 2^>nul' ) do (
if "%%b"=="0x4" echo     USB is Close
if "%%b"=="0x3" echo     USB is Open??Please Tag It.
if "%%b"=="0x4" echo     USB is Close>>%COMPUTERNAME%.txt
if "%%b"=="0x3" echo     USB is Open??Please Tag It.>>%COMPUTERNAME%.txt
)
goto last
:win7
for /f "tokens=2* delims==:" %%a in ('ipconfig/all^|find /i "IPV4"') do (
set  name=%%a
echo      IP Address = %%a>>%COMPUTERNAME%.txt
)
echo Start Software Viewer For Win7/8 ...
rem for 32 win7
echo.>>%COMPUTERNAME%.txt
echo Software Information:>>%COMPUTERNAME%.txt
for /f "tokens=7 delims=" %%i in ('reg query "HKLMSOFTWAREMicrosoftWindowsCurrentVersionUninstall" ^| findstr /v "KB" 2^>nul ') do (
for /f "skip=2 tokens=3* delims= " %%a in ('reg query "HKLMSOFTWAREMicrosoftWindowsCurrentVersionUninstall\%%i" /v DisplayName 2^>nul') do (
echo %%a %%b>>%COMPUTERNAME%.txt
)
)
for /f "tokens=8 delims=" %%i in ('reg query "HKLMSOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionUninstall" 2^>nul ^| findstr /v "KB" 2^>nul ') do (
for /f "skip=2 tokens=3* delims= " %%a in ('reg query "HKLMSOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionUninstall\%%i" /v DisplayName 2^>nul') do (
echo %%a %%b>>%COMPUTERNAME%.txt
)
)
for /f "tokens=2 delims=" %%x in ('reg query HKU') do (
for /f "tokens=8 delims=" %%a in ('reg query "HKU\%%xSoftwareMicrosoftWindowsCurrentVersionUninstall" 2^>nul') do (
for /f "skip=2 tokens=2*" %%i in ('reg query "HKU\%%xSoftwareMicrosoftWindowsCurrentVersionUninstall\%%a"  /v "DisplayName" 2^>nul') do (
echo %%j>>%COMPUTERNAME%.txt
)
)
)
for /f "tokens=2 delims=" %%x in ('reg query HKU') do (
for /f "tokens=9 delims=" %%a in ('reg query "HKU\%%xSoftwareWow6432NodeMicrosoftWindowsCurrentVersionUninstall" 2^>nul') do (
for /f "skip=2 tokens=2*" %%i in ('reg query "HKU\%%xSoftwareWow6432NodeMicrosoftWindowsCurrentVersionUninstall\%%a"  /v "DisplayName" 2^>nul') do (
echo %%j>>%COMPUTERNAME%.txt
)
)
)
echo ==================================================================
echo USB Information:
echo.>>%COMPUTERNAME%.txt
echo USB Information:>>%COMPUTERNAME%.txt
for /f "skip=2 tokens=2*" %%a in ('reg query "HKLMSYSTEMCurrentControlSetServicesusbstor" /v "start" 2^>nul' ) do (
if "%%b"=="0x4" echo     USB is Close
if "%%b"=="0x3" echo     USB is Open??Please Tag It.
if "%%b"=="0x4" echo     USB is Close>>%COMPUTERNAME%.txt
if "%%b"=="0x3" echo     USB is Open??Please Tag It.>>%COMPUTERNAME%.txt
)
:last
echo ==================================================================
echo Admin Users:
echo.>>%COMPUTERNAME%.txt
echo Admin Users:>>%COMPUTERNAME%.txt
for /f "skip=6 tokens=*" %%i in ('net localgroup Administrators ^| findstr /v "?" ^| findstr /v "??" ^| findstr /v "command"') do (
echo       %%i
echo       %%i>>%COMPUTERNAME%.txt
)
echo Power Users:
echo.>>%COMPUTERNAME%.txt
echo Power Users:>>%COMPUTERNAME%.txt
for /f "skip=6 tokens=*" %%i in ('net localgroup "Power Users" ^| findstr /v "?" ^| findstr /v "??" ^| findstr /v "command"') do (
echo       %%i
echo       %%i>>%COMPUTERNAME%.txt
)
echo ==================================================================
echo FileShare Information:
echo.>>%COMPUTERNAME%.txt
echo FileShare Information:>>%COMPUTERNAME%.txt
for /f "skip=4 tokens=*" %%i in ('net share 2^>nul ^| findstr /v "?" ^| findstr /v "??" ^| findstr /v "command"' ) do (
echo  %%i
echo  %%i>>%COMPUTERNAME%.txt
)
echo =========================Viewer Over==============================
net use \192.168.1.1 password /user:username 1>nul 2>nul
copy %COMPUTERNAME%.txt \192.168.1.1HardFile$
net use \192.168.1.1IPC$ /del 1>nul 2>nul
pause
start %COMPUTERNAME%.txt