Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :: Released under the GNU General Public License version 3 by J2897.
- @echo OFF
- pushd "%~dp0"
- goto start
- REM Run this on the remote machine to disable the "UAC Remote Restrictions"...
- REM This will not disable the UAC. So use the "-h" option in PsExec if you want privilege elevation.
- reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f
- :start
- color 0A
- setlocal
- set "PSEXEC=%USERPROFILE%\Programs\Sysinternals Suite\psexec.exe"
- call :credentials.bat
- cmdkey /add:"%COMPUTER%" /user:"%COMPUTER%\%NAME%" /pass:"%PASSWORD%"
- cmdkey /list
- explorer "%FOLDER%"
- echo Type 'exit' to quit...
- "%PSEXEC%" -h "\\%COMPUTER%" cmd.exe
- cmdkey /delete:"%COMPUTER%"
- cmdkey /list
- endlocal
- popd
- echo.
- pause
- exit /b 0
- REM You can delete these and put them in a separate file called "credentials.bat".
- REM You can then use that same file for other PS Tools too.
- REM Just remember to delete the colon (:) from line 15.
- :credentials.bat
- REM Set the remote computer credentials...
- set "COMPUTER=7x64-VM1"
- set "NAME=J2897"
- set "PASSWORD=abc123"
- set "FOLDER=\\%COMPUTER%\"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement