VBScript registry script writing

Source: Internet
Author: User

Wscript. Echo "enabling Kerberos logging ..."
Const HKEY_LOCAL_MACHINE = & h80000002
Strcomputer = "."
Set stdout = wscript. stdout
Set oreg = GetObject ("winmgmts: {impersonationlevel = impersonate }! \\"&_
Strcomputer & "\ Root \ default: stdregprov ")
Strkeypath = "SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Run"
'================================================ ==========================================================
'Position of the created item
Oreg. createkey HKEY_LOCAL_MACHINE, strkeypath
'Start the Project Creation type
'========================================== 1' reg _ SZ string value ========================================== ========
Strvaluename = "SysExplr"
'Create a string name
Strvalue = "d :\\ herosoft \ herov8 \ SysExplr. EXE"
'Create string data
Oreg. setstringvalue HKEY_LOCAL_MACHINE, strkeypath, strvaluename, strvalue
'Created type string
'=====================================================2. REG_DWORD DWORD Value ======================================== ======
Strvaluename = "DWORD Value Name"
'Create DWORD name
Dwvalue = 82
'Create DWORD data
Oreg. setdwordvalue HKEY_LOCAL_MACHINE, strkeypath, strvaluename, dwvalue
'Created DWORD
'================================================ 3. REG_EXPAND_SZ expandable string value ====================================== ======
Strvaluename = "expanded string value name"
'Create extended string name
Strvalue = "% pathext %"
'String data
Oreg. setexpandedstringvalue HKEY_LOCAL_MACHINE, strkeypath, strvaluename, strvalue
'The created type is an extended string
'================================================ = 4. reg_multi_sz multi-string value ======================================== =====
Strvaluename = "multi string value name"
'Create a multi-string name
Arrstringvalues = array ("first string", "second string", "third string", "fourth string ")
'Create a multi-string value
Oreg. setmultistringvalue HKEY_LOCAL_MACHINE, strkeypath, strvaluename, arrstringvalues
'The created type is a multi-string value.
'================================================ ========================================================== ========
Oreg. deletekey HKEY_LOCAL_MACHINE, strkeypath

Strkeypath = "SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Run"
Oreg. createkey HKEY_LOCAL_MACHINE, strkeypath
Wscript. Echo "-= [complete!] = -"

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.