Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Help with WMI function


  • Please log in to reply
2 replies to this topic
fooztr
  • Members
  • 10 posts
  • Last active: Sep 23 2015 02:09 PM
  • Joined: 28 Aug 2012
Hey,

Im trying to figure out how to run my script to find out information about a remote-host. In this case i'm trying to get the model name of a laptop.

When i replace %Key% with the remote-host ip it works. But I want to build in this to a GUI and its not going well for me.

Error attached (RPC server is unavailable)
Posted Image

If you cant see the picture on the error: http://fuskbugg.se/d...C15304E0F0D.jpg

#NoEnv
#NoTrayIcon
#Persistent


Gui Add, Edit, w250 vKey
Gui Add, Button, w250, Test
Gui Show, Center, Test WMI
Return

ButtonTest:
GuiControlGet , Key ; Grep value in textbox
strComputer := "%Key%"


objWMI := ComObjGet("winmgmts:\\" strComputer "\root\CIMV2")
colCS := objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem")

For objItem in colItems
{
MsgBox, % "Model: " objItem.Model
}
Return


fooztr
  • Members
  • 10 posts
  • Last active: Sep 23 2015 02:09 PM
  • Joined: 28 Aug 2012
bump

maul.esel
  • Members
  • 790 posts
  • Last active: Jan 05 2013 09:26 PM
  • Joined: 28 Feb 2011
strComputer := Key

Join the discussion on The future of AutoHotkey
Posted Image Visit me on github Posted Image
Win7 HP SP1 64bit | AHK_L U 64bit