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!