Advertisement
Alexqq11

assocx

Dec 23rd, 2015
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.51 KB | None | 0 0
  1. @echo off
  2. setlocal
  3. if "%1"=="*" (
  4. set temp=*
  5. goto:start)
  6. reg query HKCR\.%1 1>nul 2>nul
  7. if %errorlevel%==1 goto:error
  8. for /F "tokens=4* delims= " %%i in ('reg QUERY "HKCR\.%1" /ve') do (
  9. set temp=%%i
  10. ) 2>nul
  11. echo %temp%
  12. :start
  13. for /F "tokens=4 delims=\" %%a in ('reg QUERY "HKCR\%temp%\shell" 2^>nul') do (
  14. for /F "tokens=3*" %%i in ('reg query "HKCR\%temp%\shell\%%a\command" /ve 2^>nul') do echo %%a: %%j ) 2>nul
  15. if %errorlevel%==1 goto :error
  16. exit /b
  17. :error
  18. echo this file not exist
  19. goto :EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement