Remove RAR Right key extract menu of VBS code

Source: Internet
Author: User
Tags rar
Two days ago wrote a batch processing, efficiency is not high, Baidu, Google found a better way

Principle: http://demon.tw/programming/vbs-binary-file-another.html

Copy Code code as follows:


Public readbinary
Readbinarydat (". 1.exe")
Binarydat = replace (replace (readbinary, "526172211a07", " 522172211a07 ")," 807a0161 "," 807a0121 "
Writebinarydat" New.exe ", Binarydat
Function readbinarydat (FileName)
 const adtypebinary = 1
 dim stream, XMLDOM, node
 set xmldom = CreateObject ("Microsoft.XMLDOM ")
 set node = xmldom. createelement ("binary")
 node. DataType = "Bin.hex"
 set stream = CreateObject ("ADODB. Stream ")
 stream. Type = adTypeBinary
 stream. Open
 stream. LoadFromFile FileName
 node. nodeTypedValue = stream. Read
 stream. Close
 set stream = Nothing
 readbinary = node. Text
 set node = Nothing
 set xmldom = no
end Function Sub writebinarydat (FileName, Buf)
&N Bsp Const adTypeBinary = 1
 const adsavecreateoverwrite = 2
 dim stream, XMLDOM, node
 set xmldom = CreateObject ("Microsoft.XMLDOM"
 set node = xmldom. createelement ("binary")
 node. DataType = "Bin.hex"
 node. Text = Buf
 set stream = CreateObject ("ADODB. Stream ")
 stream. Type = adTypeBinary
 stream. Open
 stream.write node. nodeTypedValue
 stream.savetofile FileName, Adsavecreateoverwrite
 stream. Close
 set stream = no
 set node = Nothing
 set xmldom = Nothing
End Sub

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.