locked
script for installing exe file is not woring on remote machine RRS feed

  • Question

  • @ECHO OFF


    for /f %%i in (Computers.txt) do (


          XCOPY .\jre-8u111-windows-x64.exe "\\%%i\c$\temp\" /Y



    cmd /c \\%%i\C$\Temp\jre-8u111-windows-x64.exe  /s /L E:\Java\setup.log

    )

    pause

    ------

    I have created the above script and i have found it successfully copies to the remote pc's, but the installation is not happening.

    Any help/ suggestions on this is much appreciated.

        
    • Moved by Bill_Stewart Friday, April 28, 2017 7:36 PM This is not support forum for third party software
    Friday, March 3, 2017 10:36 AM

All replies

  • Hi Kart,

    well, you are running the script on a local computer. So it will of course install it on the computer it is running. If you want to remote, you'll need to run the installing logic on the remote machine.

    Best advice I can give you? Move to PowerShell:

    foreach ($Computer in (Get-Content computers.txt))
    {
        Copy-Item .\jre-8u111-windows-x64.exe "\\$Computer\C$\temp"
    }
    
    Invoke-Command -ComputerName (Get-Content computers.txt) -ScriptBlock { & C:\temp\jre-8u111-windows-x64.exe  /s /L E:\java\setup.log }

    Cheers,
    Fred


    There's no place like 127.0.0.1

    Friday, March 3, 2017 10:42 AM
  • Dear Fred, 

    First of all a Big thank you in trying to help me on this query.

    But, i am getting the below error.

    [ComputerName] Connecting to remote server failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.
        + CategoryInfo          : OpenError: (:) [], PSRemotingTransportException
        + FullyQualifiedErrorId : PSSessionStateBroken

    Regards,

    Kart

    Friday, March 3, 2017 11:58 AM
  • Hi Kart,

    well, that means you do not have PowerShell remoting enabled. If you can't do that, but have WMI access, you can run it from there instead:

    Invoke-WmiMethod -ComputerName Test -Class Win32_Process -Name Create -ArgumentList "Notepad.exe"

    Only instead of notepad, you'd be running the installer with all parameters.

    Cheers,
    Fred


    There's no place like 127.0.0.1

    Friday, March 3, 2017 1:30 PM
  • Notepad?  Remotely? 

    \_(ツ)_/

    Friday, March 3, 2017 6:33 PM
  • I got below error. if possible can you please help to fix the batch file scripts i gave in the above questions please.

    --------------------------------------------

    Invoke-WmiMethod : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
    At E:\Java\java.ps1:1 char:17
    + Invoke-WmiMethod <<<<  -ComputerName Test -Class Win32_Process -Name Create -ArgumentList "Notepad.exe"
        + CategoryInfo          : InvalidOperation: (:) [Invoke-WmiMethod], COMException
        + FullyQualifiedErrorId : InvokeWMICOMException,Microsoft.PowerShell.Commands.InvokeWmiMethod

    [pc1] Connecting to remote server failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.
        + CategoryInfo          : OpenError: (:) [], PSRemotingTransportException
        + FullyQualifiedErrorId : PSSessionStateBroken
    ---------------------------------------------------

    Thursday, March 9, 2017 2:07 PM
  • For assistance with installing java you would need to post in the Java forum.  We cannot know hw third party installers are intended to work.

    Any installer must be designed to run silently if run remotely. 

    Access denied means that you do not have sufficient permissions to perform an operation.


    \_(ツ)_/

    Thursday, March 9, 2017 2:34 PM
  • hello jvr,

    kindly ignore java. any .exe file using batch file on a remote pc.

    from my original message on top i provided in batch script , the files where copied to remote computer, but it did not install in the remote pc.


    • Edited by V V Kart Friday, March 10, 2017 12:56 PM
    Friday, March 10, 2017 12:54 PM
  • There is no magic, one size fits all, answer.  Each installer has its own rules.  You will need to contact the vendor for those rules.

    If the installer is an MSI compatible installer then look at how to install with no GUI by running the file with the "/?" option to see the command switches available.


    \_(ツ)_/

    Friday, March 10, 2017 12:58 PM