Execute or copy a file from a share

Antworten
Zakyl
Beiträge: 68
Registriert: 16 Okt 2012, 11:03

Execute or copy a file from a share

Beitrag 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 ?
bmsoft
Beiträge: 43
Registriert: 02 Feb 2012, 12:30

Re: Execute or copy a file from a share

Beitrag 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.
Zakyl
Beiträge: 68
Registriert: 16 Okt 2012, 11:03

Re: Execute or copy a file from a share

Beitrag 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 ?
bmsoft
Beiträge: 43
Registriert: 02 Feb 2012, 12:30

Re: Execute or copy a file from a share

Beitrag 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
Zakyl
Beiträge: 68
Registriert: 16 Okt 2012, 11:03

Re: Execute or copy a file from a share

Beitrag 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 ?
Zakyl
Beiträge: 68
Registriert: 16 Okt 2012, 11:03

Re: Execute or copy a file from a share

Beitrag 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
Benutzeravatar
d.oertel
uib-Team
Beiträge: 3319
Registriert: 04 Jun 2008, 14:27

Re: Execute or copy a file from a share

Beitrag 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
opsi support - uib gmbh

For productive opsi installations we recommend support contracts.
http://www.uib.de
http://www.opsi.org
Zakyl
Beiträge: 68
Registriert: 16 Okt 2012, 11:03

Re: Execute or copy a file from a share

Beitrag 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)
Benutzeravatar
d.oertel
uib-Team
Beiträge: 3319
Registriert: 04 Jun 2008, 14:27

Re: Execute or copy a file from a share

Beitrag von d.oertel »

Hi,

try to to use a 'DosInAnIcon' Sektion ..

regards
d.oertel
opsi support - uib gmbh

For productive opsi installations we recommend support contracts.
http://www.uib.de
http://www.opsi.org
Zakyl
Beiträge: 68
Registriert: 16 Okt 2012, 11:03

Re: Execute or copy a file from a share

Beitrag von Zakyl »

There is still a cmd Windows open but no messages ! If it can't do better, thanks :)
Antworten