Ad Widget

Collapse

system.run syntax?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • z_monit
    Junior Member
    • Nov 2010
    • 1

    #16
    Solution for escaping comma in remote command

    Please escape with single quote before the key system.run,

    use like below to escape with comma in system.run,

    'system.run["wmic OS get NAME,Description"]'

    Comment

    • bitmind
      Junior Member
      Zabbix Certified Specialist
      • Nov 2013
      • 5

      #17
      Hi trikke,

      I had the same problem with system.run escaping. Enclosing Command within single quotes and escaping double quotes solved my problem:

      Code:
      system.run['powershell -Command \"gp HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* |Select DisplayName,DisplayVersion,Publisher,InstallDate\"']
      Hope this helps
      Regards

      Comment

      • Clive.Miller
        Junior Member
        • Jun 2020
        • 2

        #18
        Hi,
        How do you format this system.run command, when the command needs to include a macro? For example, in LLD:
        Code:
        system.run[ls [{#dir}] | wc -l]
        doesn't work because it thinks the first ] indicates the end of the command.
        Last edited by Clive.Miller; 01-09-2021, 18:27.

        Comment

        Working...