Advertisement
J2897

PsList

Jan 1st, 2015
521
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.99 KB | None | 0 0
  1. :: Released under the GNU General Public License version 3 by J2897.
  2.  
  3. @echo OFF
  4. goto start
  5.  
  6.     REM Run this on the remote machine to enable the Remote Registry service...
  7.     net start RemoteRegistry
  8.  
  9.     REM To see whether or not the Remote Registry service is running...
  10.     sc query RemoteRegistry
  11.  
  12. :start
  13. title PsList
  14. pushd "%~dp0"
  15. setlocal
  16. set "PSLIST=%USERPROFILE%\Programs\Sysinternals Suite\pslist.exe"
  17.  
  18. call :credentials.bat
  19. cmdkey /add:"%COMPUTER%" /user:"%COMPUTER%\%NAME%" /pass:"%PASSWORD%" >nul
  20.  
  21. echo Press ESC to exit...
  22. timeout /t 3 >nul
  23. "%PSLIST%" -s "\\%COMPUTER%"
  24.  
  25. cmdkey /delete:"%COMPUTER%"
  26. cmdkey /list
  27.  
  28. endlocal
  29. popd
  30. echo.
  31. pause
  32. exit /b 0
  33.  
  34. REM You can delete these and put them in a separate file called "credentials.bat".
  35. REM You can then use that same file for other PS Tools too.
  36. REM Just remember to delete the colon (:) from line 18.
  37. :credentials.bat
  38. REM Set the remote computer credentials...
  39. set "COMPUTER=7x64-VM1"
  40. set "NAME=J2897"
  41. set "PASSWORD=abc123"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement