Software install for Newbie to Scripts

Home Forums Scripting DOS Command Shell Software install for Newbie to Scripts

This topic contains 3 replies, has 3 voices, and was last updated by Avatar universal 5 years, 9 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • Avatar
    steffg60
    Member
    #163372

    Hi Guys,

    I’ve got basic bat file skills and looking for some help with my scripts.

    Ive used Psexec to install Google Chrome on remote pc’s. This has worked fine but going forward I want to make the scripts better. Here’s what I have done so far

    psexec \PCNAME -h cmd /c “msiexec.exe /i c:googlechrome.msi /qn”

    What I want to be able to do though is rather than type the pc name for each install I want to call upon a list of pc’s from a text file and then also log if the install was successful.

    How on earth do I do that?

    Thanks in advance for any help

    Avatar
    universal
    Member
    #388608

    Re: Software install for Newbie to Scripts

    How about:

    Code:
    for /f %%a in (list_of_PCs.txt) do psexec \%%a -h cmd /c “msiexec.exe /i c:googlechrome.msi /qn”

    Replace “%%” with “%” if you’re testing this directly from the command line.

    An even better way if this is a domain environment: The Software Distribution setting in a Group Policy.

    Avatar
    prithvi
    Member
    #388034

    Re: Software install for Newbie to Scripts

    ok thanks for that .

    Any ideas how I get it to create a log file on my pc to say if its successful?

    Thanks again

    Avatar
    universal
    Member
    #388610

    Re: Software install for Newbie to Scripts

    You can relatively easily check if each psexec command was successful, as that command is run on the local system, but that won’t tell you whether the msiexec command on the remote system succeeded or not.

    Are you sure you can’t use a Group Policy for this?

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.