Announcement

Collapse
No announcement yet.

Use of %E%

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Use of %E%

    In a script where the code is strComputer = "." How do I get it to see the %E% from hyena - Thanks

  • #2
    Re: Use of %E%

    I assume you are running it as a Custom Tool? I'm not sure how your particular script works, but in the case of batch files, you can call it with something like:

    c:\run.bat %E%

    Then in run.bat access it as %1, indicating the first parameter of the command line.

    Something like:

    strComputer=%1

    Comment


    • #3
      Re: Use of %E%

      Here is my script
      *****************************************
      On Error Resume Next

      strComputer = "."
      Set objWMIService = GetObject("winmgmts:" _
      & "{impersonationLevel=impersonate}!\" & strComputer & "\root\cimv2")

      Set colItems = objWMIService.ExecQuery("Select * from Win32_IRQResource")

      For Each objItem in colItems
      Wscript.Echo "Availability: " & objItem.Availability
      Wscript.Echo "Hardware: " & objItem.Hardware
      Wscript.Echo "IRQ Number: " & objItem.IRQNumber
      Wscript.Echo "Name: " & objItem.Name
      Wscript.Echo "Trigger Level: " & objItem.TriggerLevel
      Wscript.Echo "Trigger Type: " & objItem.TriggerType
      Wscript.Echo
      Next

      Comment


      • #4
        Re: Use of %E%

        Here is my script
        *****************************************
        On Error Resume Next

        strComputer = "."
        Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate}!\" & strComputer & "\root\cimv2")

        Set colItems = objWMIService.ExecQuery("Select * from Win32_IRQResource")

        For Each objItem in colItems
        Wscript.Echo "Availability: " & objItem.Availability
        Wscript.Echo "Hardware: " & objItem.Hardware
        Wscript.Echo "IRQ Number: " & objItem.IRQNumber
        Wscript.Echo "Name: " & objItem.Name
        Wscript.Echo "Trigger Level: " & objItem.TriggerLevel
        Wscript.Echo "Trigger Type: " & objItem.TriggerType
        Wscript.Echo
        Next

        Comment


        • #5
          Re: Use of %E%

          You can use Hyena's WMI function for that. Select computer(s) in Hyena's right-hand window, then right-click and choose WMI->Execute Query. Click the New button and paste in Win32_IRQResource into the WMI Query Name and the WMI Class boxes and click OK. You can then click the properties you want and click Execute Query.

          Comment

          Working...
          X