cnytech icon

Toggle ForceAutoLogon remotely

cnytech | PRO | 06/13/14 12:52:42 PM UTC | 0 ⭐ | 5027 👁️ | Never ⏰ | []
Winbatch |

810 B

|

None

|

0 👍

/

0 👎

#Windows Batch Script to toggle registry key ForceAutoLogon
#Ideal for admins who have Windows Kiosk and POS systems and need to logon as a different user
 
@ECHO OFF
SET /P Hostname=Enter a hostname:
IF "%Hostname%"=="" GOTO Error
PSEXEC \\%Hostname% -s reg add "HKLM\SOFTWARE\microsoft\Windows NT\CurrentVersion\Winlogon" /v ForceAutoLogon /D 0 /F
if %ERRORLEVEL% NEQ 0 GOTO Failed
CLS
ECHO Force Auto Logon stopped on %Hostname%
ECHO !!! Flipping switch back in 60 seconds !!!
ping -n 60 127.0.0.1 >NUL
PSEXEC \\%Hostname% -s reg add "HKLM\SOFTWARE\microsoft\Windows NT\CurrentVersion\Winlogon" /v ForceAutoLogon /D 1 /F
CLS
Echo Force Auto Logon started on %Hostname%
Pause
GOTO End
 
:Failed
CLS
Echo Unable to break ForceAutoLogon.
pause
GOTO End
 
:Error
Echo No Hostname entered. Exiting
Pause
 
:End

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎