Quantcast
Channel: Runas CMD is not working because of quoting - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Runas CMD is not working because of quoting

$
0
0

I'm using this line in a batch file:

Runas /user:domain\user "cmd /C echo Test > C:\Program Files\Install2AgentService\Install2AgentWinService.exe.config"

The problem ist, this is only working if the path of the file has no blank spaces. And I can not put the path in quotation marks as usually because the whole CMD-command has to be in quotation marks.

Runas /user:domain\user "cmd /C echo Test > "C:\Program Files\Install2AgentService\Install2AgentWinService.exe.config""

Even escaping the double quotation marks is not working.

Runas /user:domain\user "cmd /C echo Test > ""C:\Program Files\Install2AgentService\Install2AgentWinService.exe.config"""

Does anybody have an idea how to deal with that problem? Thanks!


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images