# win\_comand / win\_shell : The system cannot find the file specified

**URL:** <https://forum.ansible.com/t/win-comand-win-shell-the-system-cannot-find-the-file-specified/23764>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [February 18, 2017, 7:50pm UTC](https://forum.ansible.com/t/win-comand-win-shell-the-system-cannot-find-the-file-specified/23764 "2017-02-18T19:50:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Norris](https://avatars.discourse-cdn.com/v4/letter/j/e79b87/32.png) [@John\_Norris](https://forum.ansible.com/u/John_Norris)\
**Post date:** [February 18, 2017, 7:50pm UTC](https://forum.ansible.com/t/win-comand-win-shell-the-system-cannot-find-the-file-specified/23764/1 "2017-02-18T19:50:54Z")

</div>

Hi,  
I am currently just trying stuff on the command line, I will do the playbook later.  
Ansible 2.2.1.0 on centos7.  
Trying to run a command on a windows 10 PC.

ansible mesh -u user -k -m win\_ping  
SSH password:  
mesh | SUCCESS =\> {  
“changed”: false,  
“ping”: “pong”  
}

So that works. But if I run

ansible mesh -u user -k -m win\_command -a ‘ng build chdir=C:\Temp\angularjs\_example\angular2\heroes\_new’  
SSH password:  
mesh | FAILED | rc=2 \>\>  
The system cannot find the file specified

or

ansible mesh -u user -k -m win\_shell -a “ng build chdir=C:\Temp\angularjs\_example\angular2\heroes\_new”  
SSH password:  
mesh | FAILED | rc=267 \>\>  
The directory name is invalid

Now the folder does exist. I have tried with escaping backslashes, in double quotes, with forward quotes. All with the same result.

Any ideas what I am doing wrong?

Regards

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [February 18, 2017, 10:27pm UTC](https://forum.ansible.com/t/win-comand-win-shell-the-system-cannot-find-the-file-specified/23764/2 "2017-02-18T22:27:02Z")

</div>

Try double backslashes in the windows style path names - these are usually needed when double quoting module parameters.

Hope this helps,

Jon

---

<div class="post-metadata">

**Author:** ![John\_Norris](https://avatars.discourse-cdn.com/v4/letter/j/e79b87/32.png) [@John\_Norris](https://forum.ansible.com/u/John_Norris)\
**Post date:** [February 19, 2017, 8:12am UTC](https://forum.ansible.com/t/win-comand-win-shell-the-system-cannot-find-the-file-specified/23764/3 "2017-02-19T08:12:12Z")

</div>

Hi Jon,  
ansible mesh -u user -k -m win\_shell -a “ng build chdir=C:\Temp\angularjs\_example\angular2\heroes\_new”  
SSH password:  
mesh | FAILED | rc=267 \>\>  
The directory name is invalid

But strangely, this does work  
ansible mesh -u user-k -m win\_shell -a “dir chdir=C:\Temp”  
SSH password:  
mesh | SUCCESS | rc=0 \>\>

Directory: C:\Temp

Mode LastWriteTime Length Name

* * *

d----- 16/02/2017 10:34 angularjs\_example

So then tried  
ansible mesh -u user -k -m win\_shell -a “ng build chdir=C:\Temp\\angularjs\_example\\angular2\\heroes\_new”  
SSH password:  
mesh | FAILED | rc=1 \>\>  
Hash: 7fac7ff8ebe8aa19c58e  
Time: 14561ms  
chunk {0} main.bundle.js, main.bundle.map (main) 50 kB {2} [initial] [rendered]  
chunk {1} styles.bundle.js, styles.bundle.map (styles) 11.7 kB {3} [initial] [rendered]  
chunk {2} vendor.bundle.js, vendor.bundle.map (vendor) 2.37 MB [initial] [rendered]  
chunk {3} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]  
ERROR in compiler\_1.StaticSymbolCache is not a constructor

And that does work. The error is a current problem in angular 2 …

Many thanks for your help.
