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?
Usage of command in hostControlSafe_execute
- n.wenselowski
- Ex-uib-Team
- Beiträge: 3194
- Registriert: 04 Apr 2013, 12:15
Re: Usage of command in hostControlSafe_execute
Hi,
did you try double-backslashes?
-Niko
did you try double-backslashes?
-Niko
Code: Alles auswählen
import OPSI
Re: Usage of command in hostControlSafe_execute
Yes, I did. Then, I get 4 \ (C:\\\\Path\\\\file.exe)
- n.wenselowski
- Ex-uib-Team
- Beiträge: 3194
- Registriert: 04 Apr 2013, 12:15
Re: Usage of command in hostControlSafe_execute
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

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
Re: Usage of command in hostControlSafe_execute
It turned out that file permissions were the problem. Thanks for all answers.