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!