Get the App
SLTechnology News&Howtos  ›  Development  › 

How reg2vbs.vbs converts Reg files to VBS files and saves them

Shulou Source: shulou.com Published: 2022-06-03 06:24:06 10月15日 Update

This article is about how reg2vbs.vbs converts Reg files to VBS files and saves them. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

The copy code is as follows:

'*

'FileName: Reg2Vbs.VBS

'Abstract: convert Reg files to VBS files to save

'*

Dim WshShell,FSO

On Error Resume Next

Set WshSHell = WScript.CreateObject ("WScript.Shell")

Set FSO = CreateObject ("Scripting.FileSystemObject")

Set Args = WScript.Arguments

CloseTime = 5

FileName = WScript.ScriptName

FileFullName = WScript.ScriptFullName

FilePath = FSO.GetParentFolderName (FileFullName)

InsPath = FSO.GetSpecialFolder (1)

InsFullName = FSO.BuildPath (InsPath, FileName)

Copyright= "exquisite Technology"

QQ= "QQ:25926183"

Email= "Email: [email = 25926183@qq.com] 25926183 @ qq.com [/ email]"

InsTitle= "Reg2Vbs-Txt"

InsAnswer= "Reg2Vbs-Txt"

RegPath2= "HKEY_CLASSES_ROOT\ regfile\ shell\ RegToVbs\"

RegValue1= "REG to VBS script File"

RegForm1= "REG_SZ"

RegPath3= "HKEY_CLASSES_ROOT\ regfile\ shell\ RegToVbs\ command\"

RegValue2= "wscript.exe"& InsFullName &" L "

RegForm2= "REG_SZ"

IF FileFullName InsFullName then

IntAnswer = MsgBox ("[Yes] add"+ InsAnswer +" to the right-click menu, "& Chr (10) & Chr (10) &" [No] remove "+ InsAnswer +"from the right-click menu.", vbQuestion + vbYesNoCancel, "install -" + InsTitle + "- by baomaboy")

If intAnswer = vbYes Then

WshSHell.RegWrite RegPath2,RegValue1,RegForm1

WshSHell.RegWrite RegPath3,RegValue2,RegForm2

FSO.GetFile (FileFullName) .Copy (InsFullName)

WshSHell.popup _

"add script file:" + chr (10) + InsFullName+chr (10) + chr (10) + _

"add registry key:" + chr (10) + chr (34) + RegPath2 + chr (34) + chr (10) + _

Chr (10) & CloseTime & "this window will close automatically after a second!" + chr (10) + chr (10) + _

Chr (10) & "Copyright (C)" + Copyright + "& QQ &" + Email _

, CloseTime, "installed successfully -" + InsTitle + "- by baomaboy", 0 + 64

End if

If intAnswer = vbNo Then

WshSHell.RegDelete RegPath3

WshSHell.RegDelete RegPath2

FSO.DeleteFile InsFullName

WshSHell.popup _

Delete script file: + chr (10) + InsFullName+chr (10) + chr (10) + _

Delete registry key: + chr (10) + chr (34) + RegPath2 + chr (34) + chr (10) + _

Chr (10) & CloseTime & "this window will close automatically after a second!" + chr (10) + chr (10) + _

Chr (10) & "Copyright (C)" + Copyright + "& QQ &" + Email _

, CloseTime, "Uninstall successfully -" + InsTitle + "- by baomaboy", 0 + 64

End if

If intAnswer = vbCancel Then

End if

ELSE

If Args.count=0 then wscript.quit

Set ReadFile = FSO.OpenTextFile (Args (0), 1meme falsefinery 1)

ReadAllText = ReadFile.ReadAll

ReadFile.Close

If mid (ReadAllText,1,3) "Win" and mid (ReadAllText,1,3) "REG" then

Set ReadFile = FSO.OpenTextFile (Args (0), 1)

ReadAllText = ReadFile.ReadAll

ReadFile.Close

End if

For iTunes 1 To Len (ReadAllText)

TempNum = Asc (Mid (ReadAllText,i,1))

If TempNum = 34 Then

TempNum = 18

ElseIf TempNum = 13 Then

TempNum = 28

ElseIf TempNum = 10 Then

TempNum = 29

End if

ThisText1 = ThisText1 & chr (TempNum)

Next

Set WriteFile = FSO.OpenTextFile (Args (0) & ".VBS", 2dint True)

WriteFile.WriteLine ("On Error Resume Next: Dim WshSHell,FSO,Reg2_Vbs:Set WshSHell = WScript.CreateObject ("WScript.Shell"): Set FSO = CreateObject ("Scripting.FileSystemObject"): Reg2Vbs="& ThisText1 &")

WriteFile.WriteLine ("Execute (" For iTunes 1 To Len (Reg2Vbs) "& vbCrLf&"TempNum = Asc (Mid (Reg2Vbs,i)") 1) "& vbCrLf&"If TempNum= 28 Then"& vbCrLf&"TempNum= 13"& vbCrLf&"ElseIf TempNum= 29 Then" & vbCrLf& "" TempNum= 10 "" & vbCrLf& "" elseif TempNum=18 Then "& vbCrLf&"TempNum= 34" & vbCrLf& "" End If "& vbCrLf&" ThisText2 = ThisText2 & chr (TempNum) "" & vbCrLf& "" Next "") ")

WriteFile.WriteLine ("Set RegFile = FSO.OpenTextFile (FSO.BuildPath (FSO.GetSpecialFolder (2),"Temp.reg"), 2): RegFile.WriteLine (ThisText2): RegFile.Close:WshSHell.Run ("" regedit / s "" & FSO.BuildPath (FSO.GetSpecialFolder (2), "Temp.reg")): WScript.Sleep 500:FSO.DeleteFile FSO.BuildPath (FSO.GetSpecialFolder (2), "" Temp.reg "") ")

WriteFile.Close

End if

Set WshSHell = Nothing

Set FSO = Nothing

Set Args = Nothing

WScript.Quit (0)

Thank you for reading! On "reg2vbs.vbs how to convert Reg files into VBS files to save" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, you can share it out for more people to see it!

Tags: Files scripts success code content more registry articles menus good practical exquisite articles see knowledge technology reference help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Shulou Information OPPO Reno Shulou Tech Info MySQL