Search code examples
autoitwmic

AutoIT and quotes


I need to create AutoIT script which will call this:

wmic path win32_tcpipprinterport where "hostaddress = 'server1'"  set hostaddress="server2"

tried to combine quotes like this:

$CMD = 'wmic path win32_tcpipprinterport where ""hostaddress = ''server1''""  set hostaddress=""server2"" & pause'

RunWait(@ComSpec & " /c " & $CMD)

But still cannot make it working. Please can you help ?


Solution

  • But still cannot make it working.

    Example:

    $sCmd = 'wmic path win32_tcpipprinterport where "hostaddress = ''server1''" set hostaddress="server2"'
    

    Related.