Nick,
I saw it mentioned somewhere that if you use 'YAML syntax' with the :'s
instead of Ansibles ='s you should not need escape characters for
directories with spaces in them. Ie, if you do it like this:
- win_command: runsomething.exe
args:
chdir: c:\Program Files\Application
The other thing I can think of is adding single quotes ' around the path.
Sadly I don't have any Windows boxes around that I can test this on right
now for you, but it could be worth a try?
Cheers, Mike
On Wed, Jul 26, 2017 at 4:17 PM Nick Couchman <[email protected]>
wrote:
> So, I'm trying to run a command via Ansible, and the command exists in a
> path that's in a directory with spaces, namely c:\Program Files. I need
> the module to chdir to the directory where the command is actually located
> because there are files that it needs to reference inside that directory.
> Unfortunately it doesn't seem to want to work, no matter what I try. I've
> tried the following variations on the path to make it work:
> C:\Program Files\Application
> C:\\Program Files\\Application
> C:\\Program\ Files\\Application
> C:\\Program^ Files\\Application
> C:/Program Files/Application
> C:/Program\ Files/Application
>
> No matter what I try, here, I get the following message from the module:
>
> The directory name is invalid
>
> What's the trick to making chdir work for directories with spaces??
>
> Thanks - Nick
>
> --
> 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/8581aa1e-4010-4616-b399-771acf2fa96f%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/8581aa1e-4010-4616-b399-771acf2fa96f%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
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/CAMuthMedQ2NFSi%3D3pMphtqsxoZ216oYed5udZnb6i5Rv_io3jA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.