I am trying to find the correct translation for:
;dim WMIObj, strHost, intProcessID
;on error resume next
;strHost = "remotehost.domain.com"
;set WMIObj = GetObject("winmgmts:\\" & strHost & "\root\cimv2:Win32_Process")
;if IsObject(WMIObj) then
;I need the right Winbatch translation for this next line:
;WMIObj.Create "cmd.exe /C msg * ""ha-ha-ha""", null, null, intProcessID ;Need Winbatch syntax .....
;end if
;set WMIObj = nothing
;Winbatch next
ComputerName = "olisws00"
objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\%ComputerName%\root\cimv2")
objWMIService.Create("cmd.exe /C msg * ""ha-ha-ha"","","","") ;Needs correct syntax
I go it.
objWMIService.Create("cmd.exe /C msg * ""ha-ha-ha""",,,)
Thanks...
This WMI code actually works to send a message to other computers ....
ComputerName = "computer"
objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\%ComputerName%\root\cimv2:Win32_Process")
objWMIService.Create("cmd.exe /C msg * ""ha-ha-ha""",,,)
pretty cool code snip....now...how to get to to work over a WAN?