SO the problem I have now is if I try and add args eg

win_shell: '"{{uninstall}}" /S _?="{{installloc}}"'

It fails to run it with "unable to exec C:\Program.exe" - ie the single 
quote i had around the "{{uninstall}" previously have moved around the 
entire command, but it now has issue with whitepsace in {{ uninstall }} 
variable path.

If I put the single qoute back around the {{uninstall}} with parameters 
after..

win_shell: '"{{uninstall}}"' /S _?="{{installloc}}"

I get a syntax error on the /S (even with qouting attempt on this 
parameters).

Any ideas anyone?

Thanks

On Wednesday, December 13, 2017 at 9:52:29 AM UTC, Gareth Stockdale wrote:
>
> OK so I go the basic command working with...
>
> win_command: '"{{ uninstall}}"'
>
> Now working on the extra arguments
>
>
>
> On Wednesday, December 13, 2017 at 9:32:14 AM UTC, Gareth Stockdale wrote:
>>
>> I have some vendor software where I am trying to uninstall (following 
>> their procedure) by obtaining the uninstall command and install location 
>> from the windows registry.  I do this by querying win_reg_stat and storing 
>> result in two facts.   I am then trying to execute the variable via 
>> win_shell and win_command in various guises but with no success.  Even 
>> stripping it back to the bare uninstall command with no parameters is 
>> proving difficult  eg
>>
>>
>> win_shell: "{{ uninstall }}" 
>> args:
>>     executable: cmd
>>
>> or
>>
>> win_command: "{{ uninstall}}"
>>
>>
>> Worth noting, the registry variable contain spaces in the directory 
>> path(eg C:\Program Files x86\blah\blah\uninstall).
>>
>> I have tried various combinations of \", ' characters but seem 
>> unsuccessful.  
>>
>> Anyone got a working example of executing a DOS command when defined as a 
>> variable with spaces in its directory path?
>>
>> Thanks
>> Gareth
>>
>>
>>
>>
>>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4b71398a-86f4-4361-ae73-604deb9ce7ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to