batch script to install software over network

I am trying to install java over the network using psexec.  The below batch works if executed from the local machine, however from psexec gives a "exiting with error code 1".

I am not sure what is caausing it, i read a couple places that it has to do with permissions, but since I am using psexec that should not matter.  My other batches work with admin permissions using psexec.  

@ECHO OFF
SET MyDIR=%~dp0 

echo. installing java 6 update 31...
start /wait /low \\server\share\jre6.exe /s

Open in new window

icecom4Asked:
Who is Participating?
 
danielmarkoCommented:
I have used psexec but I always copy the install files to a local temp folder and then run it from there.
try

@ECHO OFF
SET MyDIR=%~dp0
echo. installing java 6 update 31...
copy \\server\share\jre6.exe c:\temp\jre6.exe

start /wait /low c:\temp\jre6.exe  /s
                                  1:
0
 
Raymond PengSystems EngineerCommented:
You need to run psexec -u username -p password

username/password needs to be a login with access to the share.  You need to explicitly tell psexec
0
 
icecom4Author Commented:
@ dan...hmmm i will try that.  but whats that 1: for under the script??


@133
I forgot to mention that I am using the ezexecute utility for psexec...so the username and password get entered in before the batch,  The folder on the share is set to allow everyone all permissions, but not administrator.
0
 
icecom4Author Commented:
I did both of your recommendations.  I had to remove the c:\temp because that does not exist...and so the batch could not find it but other than that it is now copying and executing.

Thanks
0
 
danielmarkoCommented:
great
the 1 was me fat fingering it. ignore.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.