Skip to content

Instantly share code, notes, and snippets.

@redneck-f25
Created December 23, 2021 05:20
Show Gist options
  • Save redneck-f25/4363b846354ab75d66606e45ae7ac86e to your computer and use it in GitHub Desktop.
Save redneck-f25/4363b846354ab75d66606e45ae7ac86e to your computer and use it in GitHub Desktop.
Change password through RDP without Ctrl-Alt-Del
<!-- : @author daniel.hammerschmidt@bitctrl.de
@echo off & setlocal enableextensions enabledelayedexpansion
title %~n0
mode con cols=80 lines=15
set "xcopyprompt="
for /f "usebackq delims=" %%a in (`xcopy /lw "%~f0" "%~f0" 2^>nul ^<nul`) do if not defined xcopyprompt set "xcopyprompt=%%a"
for /l %%_ in (0,0,1) do (
cscript //nologo "%~f0?.wsf"
ping -n 2 localhost > nul 2> nul
color 5e
echo.
echo. Press ^<X^> to exit and log off.
echo. Press another key to call Windows Security again.
echo. Press ^<Ctrl^>+^<C^> to close this window.
set "c="
for /f "usebackq delims=" %%a in (`xcopy /lw "%~f0" "%~f0" 2^>nul`) do if not defined c set "c=%%a"
set "c=!c:%xcopyprompt%=!"
color 07
cls
if "!c!" == "" exit
if /i "!c!" == "x" shutdown -l & for /l %%_ in (0,0,1) do pause >nul
)
exit /b & rem -->
<package><job><script language="JScript">
new ActiveXObject( 'Shell.Application' ).WindowsSecurity();
</script></job></package>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment