I am using BMC's nexec command to execute commands on a remote Windows machine, and I'm having trouble properly escaping spaces in file paths.
For example, the following command works fine:
nexec $FQDN cmd.exe /c "dir "C:\Tools""
However, when I try to execute a command with a file path containing a space, such as "C:\Program Files", it doesn't work:
nexec $FQDN cmd.exe /c "dir "C:\Program Files""
I have tried various methods of escaping the spaces, including using single quotes and the caret symbol ^
as an escape character, but none of these approaches seem to work:
nexec $FQDN cmd.exe /c "call dir ^"C:\Program Files^""
I would appreciate any suggestions on how to properly escape spaces in file paths for remote Windows command execution using BMC nexec. Please provide examples or explanations of the correct syntax to use in this situation. Thank you!