I am trying to call a batch file from a PowerShell 5.0 Script. The path for the batch file is :
\\192.168.0.1\hde_path\Tools Powershell\abc.cmd
So, my path has a white space inside it and I tried to call it in the following way..
cmd.exe /c "'\\192.168.0.1\hde_path\Tools Powershell\abc.cmd'"
Now, it gives the error:
The system can not find the file specified.
But, please note:
- This file abc.cmd exists in this location.
- I have access to this location. Because, I can run this abc.cmd file via command prompt without any issues.
Again, when I am putting abc.cmd file in some path where the path does not have any space in it, e.g. : \192.168.0.1\hde_path\Tools\abc.cmd and I call it using the following command, it runs perfectly fine.
cmd.exe /c '\\192.168.0.1\hde_path\Tools\abc.cmd'
Please help!
cmd.exe /c "\\192.168.0.1\hde_path\Tools\abc.cmd"cmduses"for quotation,'are just considered normal characters...