Usage of command in hostControlSafe_execute

Antworten
stept_
Beiträge: 9
Registriert: 28 Mär 2015, 23:18

Usage of command in hostControlSafe_execute

Beitrag 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?
Benutzeravatar
n.wenselowski
Ex-uib-Team
Beiträge: 3194
Registriert: 04 Apr 2013, 12:15

Re: Usage of command in hostControlSafe_execute

Beitrag von n.wenselowski »

Hi,

did you try double-backslashes?


-Niko

Code: Alles auswählen

import OPSI
stept_
Beiträge: 9
Registriert: 28 Mär 2015, 23:18

Re: Usage of command in hostControlSafe_execute

Beitrag von stept_ »

Yes, I did. Then, I get 4 \ (C:\\\\Path\\\\file.exe)
Benutzeravatar
n.wenselowski
Ex-uib-Team
Beiträge: 3194
Registriert: 04 Apr 2013, 12:15

Re: Usage of command in hostControlSafe_execute

Beitrag 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 ;)

Code: Alles auswählen

import OPSI
stept_
Beiträge: 9
Registriert: 28 Mär 2015, 23:18

Re: Usage of command in hostControlSafe_execute

Beitrag von stept_ »

It turned out that file permissions were the problem. Thanks for all answers.
Antworten