Implement WIN7 System fast one-click Switch User's BAT script _dos/bat

Source: Internet
Author: User
Tags goto

We use the computer, occasionally will need to switch the user's situation more frequently, although the "win+l" switch process is not complicated, but the hot key + click "Switch User" button + input password, this series of action, before and after also need to use seven or eight seconds of time. In fact, only through a simple batch function, you can achieve in a key switching system user functions, BAT implementation is as follows:

Copy Code code as follows:

:: Batch processing Implementation Win7 One-click Switch User

:: The following code can automatically trigger Win7 "UAC" to automatically determine whether the current user is running for an administrator, if not

:: Eject the "Run as Administrator" window! Prevent users who have "UAC" turned on, and solve the problem of no permissions!

:: Also remove the right key to "Run as administrator" this operation!

@pushd "%temp%"

@echo. >%systemroot%\tektea.uac

@if exist%systemroot%\flyfish.uac Goto startwithadmin

@echo Set UAC = createobject^ ("shell.application" ^) >fadm.vbs

@echo UAC. ShellExecute "%~0", "%*", "" "," RunAs ", 1 >>fadm.vbs

@Fadm. vbs

@goto: EOF

: Startwithadmin

@del%systemroot%\tektea.uac

@if exist Fadm.vbs del Fadm.vbs

@pushd "%~dp0"

:: Enable Windows "Secondary logon" (two logon) service, some system protection software may disable this service!

sc config Seclogon start= auto

net start Seclogon

:: End Current Desktop program

Taskkill/im explorer.exe/f

:: Use runas to specify the user to switch and boot to the user's desktop, if the account to be switched is not logged in, this is the first prompt to enter the password to switch users!

Runas/savecred/profile/user:administrator%SystemRoot%\Explorer.exe

::p ing local 5 times, realize the delay to see if you have "disabled null password logon" (if not successfully switched!) )

Save the batch above as a quick switch user. bat!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.