0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

メモ: WMI

Posted at

キーコード

Windows キー : &H5B

user32 keybd_event

モニター一覧

getmonitor.vbs
Option Explicit

Dim strComputer, objWMIService, colItems, objItem

strComputer = "."

Set objWMIService = GetObject("winmgmts:" _ 
  & "{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" _ 
  & strComputer & "\root\wmi") 

Set colItems = objWMIService.ExecQuery _
  ("SELECT * FROM WMIMonitorID")

For Each objItem In colItems
  Wscript.Echo objItem.InstanceName
Next

マルチモニター数.vbs
strComputer = "."
set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" & strComputer & "\root\wmi") 
set colItems = objWMI.ExecQuery ("SELECT * FROM WMIMonitorID")
msgbox strComputer & " has " & colItems.count & " monitors configured"

PCにしゃべらせる

voice.bat
mshta.exe vbscript:Execute("CreateObject(""SAPI.SpVoice"").Speak ""おはようございます"":Close")

画面キャプチャ

printscreen.bat
mshta vbscript:execute("Set a=CreateObject(""Excel.Application""):a.ExecuteExcel4Macro(""CALL(""""user32"""",""""keybd_event"""",""""JJJJJ"""",44,0,1,0)""):a.ExecuteExcel4Macro(""CALL(""""user32"""",""""keybd_event"""",""""JJJJJ"""",44,0,2,0)""):close()")

該当のプロセス一覧

Get-WmiObject -query "select * from win32_process where (name = 'msedge.exe')"
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?