|
|
楼主 |
发表于 2024-5-4 20:50:15
|
显示全部楼层
本帖最后由 jyswjjgdwtdtj 于 2024-5-18 13:32 编辑
选择一些有意思的com组件的实例- (new-object -comobject IE_FULL_SCREEN.IEKeyControl).sendf11()
复制代码- set w=createobject("IE_FULL_SCREEN.IEKeyControl")
- w.sendf11
- wscript.stdin.readline
复制代码 强制最大化了我的控制台窗口 还隐藏了右上角的–▢x(其实就是按F11键)- Set html = CreateObject("htmlfile")
- Set window = html.parentWindow
- jsonstr="{""hello"":""goodbye""}"
- window.execScript "var json = " & jsonstr, "JScript"
- Set json = window.json
复制代码 解析json- set s=createobject("shell.application")
- s.minimizeall
复制代码 最小化所有窗口- Option Explicit
- Dim se, fso
- Dim argv, file, str
- 'VBScript Encoder
- 'Author: Demon
- 'Website: https://demon.tw
- Set se = CreateObject("Scripting.Encoder")
- Set fso = CreateObject("Scripting.FilesystemObject")
- For Each argv In WScript.Arguments
- Set file = fso.OpenTextFile(argv)
- str = file.ReadAll
- file.Close
- str = se.EncodeScriptFile(".vbs", str, 0 , "")
- argv = Left(argv, Len(argv)-3) & ".vbe"
- Set file = fso.OpenTextFile(argv, 2, True)
- file.Write str
- file.Close
- Next
- MsgBox "OK", vbInformation
复制代码 加密vbs至vbe 摘自demon- ' 40_FileHash.VBS
- ' UMU @ 22:45 2011/8/10
- Option Explicit
- Dim wi
- Dim file
- Dim file_size
- Dim file_attributes
- Dim file_version
- Dim file_hash
- Set wi = CreateObject("WindowsInstaller.Installer")
- file = "C:\WINDOWS\explorer.exe"
- file_size = wi.FileSize(file)
- file_attributes = wi.FileAttributes(file)
- file_version = wi.FileVersion(file)
- file_hash = GetFileHash(file)
- Set wi = Nothing
- MsgBox "File: " & file & vbCrLf & _
- "Size: " & file_size & vbCrLf & _
- "Attributes: " & file_attributes & vbCrLf & _
- "Version: " & file_version & vbCrLf & _
- "MD5: " & file_hash
- Function GetFileHash(file_name)
- Dim file_hash
- Dim hash_value
- Dim i
-
- Set file_hash = wi.FileHash(file_name, 0)
-
- hash_value = ""
-
- For i = 1 To file_hash.FieldCount
- hash_value = hash_value & BigEndianHex(file_hash.IntegerData(i))
- Next
-
- GetFileHash = hash_value
-
- Set file_hash = Nothing
- End Function
- Function BigEndianHex(Int)
- Dim result
- Dim b1, b2, b3, b4
-
- result = Hex(Int)
- b1 = Mid(result, 7, 2)
- b2 = Mid(result, 5, 2)
- b3 = Mid(result, 3, 2)
- b4 = Mid(result, 1, 2)
-
- BigEndianHex = b1 & b2 & b3 & b4
- End Function
复制代码 计算文件 MD5 hash 值- set w=createobject("wscript.shell")
- set b=w.exec("powershell -windowstyle hidden exit")
- wscript.stdin.readline()
复制代码 cscript执行时最小化自生(按我的想法理应隐藏自身啊?)- Sub UnZip(ByVal myZipFile, ByVal myTargetDir)
- Set fso = CreateObject("Scripting.FileSystemObject")
- If NOT fso.FileExists(myZipFile) Then
- Exit Sub
- ElseIf fso.GetExtensionName(myZipFile) <> "zip" Then
- Exit Sub
- ElseIf NOT fso.FolderExists(myTargetDir) Then
- fso.CreateFolder(myTargetDir)
- End If
- Set objShell = CreateObject("Shell.Application")
- Set objSource = objShell.NameSpace(myZipFile)
- Set objFolderItem = objSource.Items()
- Set objTarget = objShell.NameSpace(myTargetDir)
- intOptions = 256
- objTarget.CopyHere objFolderItem, intOptions
- End Sub
复制代码 解压zip文件 该对象也可以做到压缩 可惜对于带密码的做不到 摘自demon- '设置剪切板的内容
- Dim Form, TextBox
- Set Form = CreateObject("Forms.Form.1")
- Set TextBox = Form.Controls.Add("Forms.TextBox.1").Object
- TextBox.MultiLine = True
- TextBox.Text = "忘记了,喜欢一个人的感觉"
- TextBox.SelStart = 0
- TextBox.SelLength = TextBox.TextLength
- TextBox.Copy
- '获取剪切板的内容
- Dim Form, TextBox
- Set Form = CreateObject("Forms.Form.1")
- Set TextBox = Form.Controls.Add("Forms.TextBox.1").Object
- TextBox.MultiLine = True
- If TextBox.CanPaste Then
- TextBox.Paste
- WScript.Echo TextBox.Text
- End If
复制代码 别致的剪贴板获取方法 摘自demon- Set WshShell = wscript.CreateObject("WScript.Shell")
- MsgBox "打开计算器",,"神奇的中文"
- WshShell.Sendkeys "品"
- MsgBox "打开芊芊静听",,"神奇的中文"
- WshShell.Sendkeys "频"
- MsgBox "打开我的电脑",,"神奇的中文"
- WshShell.Sendkeys "赌"
- Set WshShell = Nothing
复制代码 有趣的虚拟键码- set w=createobject("Internet.HHCtrl")
- do
- w.textpopup "hello!",1,1,1,1,1
- wscript.sleep 50
- loop
复制代码 让hello持续跟随你的鼠标- set hdlg=createobject("HtmlDlgHelper.HtmlDlgHelper.1")
- msgbox hdlg.getcharset("example")
- '134 中文字符集
- msgbox hdlg.getcharset("Symbol")
- '2 系统默认字符集
复制代码 看看电脑会用什么字符集来显示字符- <!--==hta==-->
- <object id=HtmlDlgHelper classid=CLSID:3050f4e1-98b5-11cf-bb82-00aa00bdce0b></object>
- <script language=vbscript>
- sub window_onload()
- set a=HtmlDlgHelper.object.fonts
- for i=0 to a.length
- msgbox a.item(i)
- next
- end sub
- </script>
- <body>
- qqqq
- </body>
复制代码 输出所有字体 |
|