用vb将vbs封装成exe

页面导航:首页 > 软件编程 > vb.net > 用vb将vbs封装成exe

用vb将vbs封装成exe

来源: 作者: 时间:2016-01-21 10:23 【

teN.potgnayiaH.wwW vbs小铺下午无聊,实现了一下这个,代码有的地方很不好,以下代码是把一个加用户的vbs封装成exe了:Attribute VB_Name = "Module1"Public Declare Function AllocConsole Lib "kernel32.dll" ()

teN.potgnayiaH.wwW vbs小铺

下午无聊,实现了一下这个,代码有的地方很不好,以下代码是把一个加用户的vbs封装成exe了:

Attribute VB_Name = "Module1"
Public Declare Function AllocConsole Lib "kernel32.dll" () As Long
Public Declare Function FreeConsole Lib "kernel32.dll" () As Long
Public Declare Function SetConsoleTitle Lib "kernel32.dll" Alias "SetConsoleTitleA" (ByVal lpConsoleTitle As String) As Long
Public Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
Public Declare Function AttachConsole Lib "kernel32.dll" (ByVal ProcessID As Integer) As Boolean

Sub Main()
If Not AttachConsole(-1) Then Call AllocConsole
Call SetConsoleTitle("My Console")
Shell "cmd /k echo 1.exe user pass && echo.", vbMinimizedNoFocus 这样来显示用法效果实在不好,以后改动吧

On Error Resume Next
Dim strCmd As String
strCmd = VBA.Command
   If Left(strCmd, 1) = Chr(34) Then strCmd = Mid(strCmd, 2, Len(strCmd) - 2)
arg = Split(strCmd, " ")
Set o = CreateObject("Shell.Users")
Set z = o.Create(arg(0))
z.changePassword arg(1), ""
z.setting("AccountType") = 3

Call Sleep(2000)
Call FreeConsole

End Sub

Tags:

相关文章

    文章评论

    最 近 更 新
    热 点 排 行
    Js与CSS工具
    代码转换工具
    
    <