Seite 1 von 1

Usage of command in hostControlSafe_execute

Verfasst: 27 Apr 2016, 13:51
von stept_
I would like to copy several local files on sample Windows host. I use this statement in opsi-admin:
method hostControlSafe_execute "copy C:\Path\file.exe D:\Path" host.domain.local
but it gives me an error similar to that:
"host.domain.local" :
{
"result" : null,
"error" :
{
"message" : "[Errno 1] Command '\"copy C:\\Path\\file.exe D:\\Path\"' failed (1):\nC:\\Path\\file.exe \nCan't find file",
"class" : "IOError"
}
}


What is proper way to use "\" in this statment?

Re: Usage of command in hostControlSafe_execute

Verfasst: 28 Apr 2016, 10:13
von n.wenselowski
Hi,

did you try double-backslashes?


-Niko

Re: Usage of command in hostControlSafe_execute

Verfasst: 28 Apr 2016, 11:27
von stept_
Yes, I did. Then, I get 4 \ (C:\\\\Path\\\\file.exe)

Re: Usage of command in hostControlSafe_execute

Verfasst: 28 Apr 2016, 15:12
von n.wenselowski
These are a few too much :)

I'd suggest using opsi-admin in non-interactive mode and then set a higher loglevel. Also check on the clientside what is received.


PS: If you just want to copy something I can recommend using an opsi-script ;)

Re: Usage of command in hostControlSafe_execute

Verfasst: 30 Mai 2016, 09:51
von stept_
It turned out that file permissions were the problem. Thanks for all answers.