Hi,

When using double quotes around windows paths, you usually have to use 2 
backslashes for the path separator, so something like the following might 
work, although I think it might try and look for a program called 
'klmover.exe -address 172.16.1.1' (instead of treating the -address 
172.16.1.1 as arguments for the klmover.exe)

raw: c:\windows\system32\cmd.exe /C "C:\\Program Files\\Kaspersky 
Lab\\Network Agent\\klmover.exe -address 172.16.1.1"

You might not need to run via the cmd.exe though so perhaps try:

raw: "C:\\Program Files\\Kaspersky Lab\\Network Agent\\klmover.exe" -address 
171.16.1.1

However, if you are using ansible 2.2 use win_command (or win_shell) 
modules instead of 'raw'. Try something like this (which I think is easier 
to read than the others above).

win_command: klmover -address 172.16.1.1
args:
  chdir: C:\Program Files\Kaspersky Lab\Network Agent\

Hope this helps,

Jon

On Wednesday, February 1, 2017 at 2:18:40 PM UTC, Dimitri Yioulos wrote:
>
> Hi, all.
>
> Another probably simple question that I need help with:
>
> I need to run a program utility on several machines, as follows:
>
> C:\Program Files\Kaspersky Lab\Network Agent\klmover.exe -address 
> 172.16.1.1
>
> I've tried running it using the raw command 
> raw: c:\windows\system32\cmd.exe /C "C:\Program Files\Kaspersky 
> Lab\Network Agent\klmover.exe -address 172.16.1.1"
>
> I've tried several combinations of quotes around the command, and changing 
> slashes/backslashes, but am not able to find a means to keep Ansible from 
> complaining e.g. ""'C:\\Program' is not recognized as an internal or 
> external command".  I think it has more to do with the spaces in the path. 
>  Anyway, I would appreciate your help.
>
> Many thanks.
>
> Dimitri
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c708de4f-3942-401a-a9df-c77eee632b34%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to