Seite 1 von 1

Execute or copy a file from a share

Verfasst: 18 Apr 2013, 16:37
von Zakyl
Hi !

I have a problem : I would like to deploy a software from a shared folder (not the OPSI share) but I always have an error.

I tried :
- WinBatch : \\ip-share\folder\exe.exe
- Files : "copy \\ip-share\folder\exe.exe C:\" and after in WinBatch "C:\exe.exe"

And same from a x: network drive

Is it possible to do it or am I force to store my executable in the same folder than my *.ins script ?

Re: Execute or copy a file from a share

Verfasst: 18 Apr 2013, 23:44
von bmsoft
Zakyl hat geschrieben: I have a problem : I would like to deploy a software from a shared folder (not the OPSI share) but I always have an error.

I tried :
- WinBatch : \\ip-share\folder\exe.exe
- Files : "copy \\ip-share\folder\exe.exe C:\" and after in WinBatch "C:\exe.exe"

And same from a x: network drive
Have you checked that the pcpatch user has access to the mentioned share? Always look from the pcpatch user's point of view, not from your viewpoint or the user that is logged in into the target host.

Re: Execute or copy a file from a share

Verfasst: 19 Apr 2013, 09:02
von Zakyl
Thank you for this tip ;)
How can I add the pcpatch user on my windows server share folder ? Did I need to add the OPSI server in the Windows domain ?

Re: Execute or copy a file from a share

Verfasst: 20 Apr 2013, 22:45
von bmsoft
Zakyl hat geschrieben: How can I add the pcpatch user on my windows server share folder ? Did I need to add the OPSI server in the Windows domain ?
try adding the user, e.g. with same credentials. hth, lorenzo

Re: Execute or copy a file from a share

Verfasst: 21 Apr 2013, 12:18
von Zakyl
Did I need to add the pcpatch group and the adminuser user ? Or is it only the pcpatch user who intervenes in the package installation processus ?

Re: Execute or copy a file from a share

Verfasst: 22 Apr 2013, 10:21
von Zakyl
I also have an error with Winbatch section :

- When I run the script locally with Winst, a windows appear with "execute" or "cancel" buttons. So I can execute my bat script. But I have that error message :

Code: Alles auswählen

[5] [avr. 22 10:14:25:190]   Execution of WinBatch_install
[6] [avr. 22 10:14:25:190]     Call "\\ip\test\test.bat"
[6] [avr. 22 10:14:25:190]        Waiting until the called process is finished
[4] [avr. 22 10:14:25:190]     winbatch call of not executable file: \\ip\test\test.bat is deprecated
- When I run the script from the web interface, I have an error in the log :

Code: Alles auswählen

[5] [avr. 22 10:17:44:668] [test]   Execution of WinBatch_install
[6] [avr. 22 10:17:44:678] [test]     Call "\\ip\test\test.bat"
[6] [avr. 22 10:17:44:678] [test]        Waiting until the called process is finished
[6] [avr. 22 10:17:44:678] [test]     Start process as invoker: pcpatch
[3] [avr. 22 10:17:44:688] [test]     Exception in StartProcess_cp: Failed to execute \\ip\test\test.bat : 1326

It's deprecated, so I tried DosBatch :

- When I try with the DosBatch, I have that error in log :

Code: Alles auswählen

[5] [avr. 22 10:19:57:831] [test] 3 DosBatch_install
[6] [avr. 22 10:19:57:831] [test]   c:\opsi.org\tmp\_winstbat_1.bat saved back
[6] [avr. 22 10:19:57:831] [test]   Executing "cmd.exe" /C "c:\opsi.org\tmp\_winstbat_1.bat"
[6] [avr. 22 10:19:57:860] [test]   ExitCode 1
[6] [avr. 22 10:19:57:870] [test]   Delete "c:\opsi.org\tmp\_winstbat_*"
[6] [avr. 22 10:19:57:870] [test]     Search "c:\opsi.org\tmp\"
[6] [avr. 22 10:19:57:870] [test]     File "c:\opsi.org\tmp\_winstbat_1.bat"
[6] [avr. 22 10:19:57:870] [test]       The file has been deleted
In my DosBatch section, I did :

Code: Alles auswählen

@echo off
"\\ip\test\test.bat"
pause
And I have that error in my cmd windows : (with pcpatch user and password on the computer)
Logon failure : Unknow user name or wrong password

Re: Execute or copy a file from a share

Verfasst: 22 Apr 2013, 11:37
von d.oertel
Hi,

I think you have to use 'net mount' to mount the share before you can execute a file on a share.

regards

d.oertel

Re: Execute or copy a file from a share

Verfasst: 22 Apr 2013, 12:19
von Zakyl
I was doing that when you post it ! It works, thanks :)

Just one more question : How can I hide the "cmd" windows when the script runs ?
(Because I "/delete" the network drive before to mount it. But if it not exist, I have the "cmd" windows with the error. The end of the script is executing without problem)

Re: Execute or copy a file from a share

Verfasst: 22 Apr 2013, 13:15
von d.oertel
Hi,

try to to use a 'DosInAnIcon' Sektion ..

regards
d.oertel

Re: Execute or copy a file from a share

Verfasst: 23 Apr 2013, 17:07
von Zakyl
There is still a cmd Windows open but no messages ! If it can't do better, thanks :)