1

I am working on a batch file that includes some tools for my local helpdesk guys to use. I am currently working on one of the tools which is to transfer and install Cisco AnyConnect for VPN usage on workstations. I was able to get the copy/transfer of the installer files down but cannot for the life of me figure out how to launch the .msi installer that is now on the remote computer. I am not very familiar with this portion of .bat files so any help would be appreciated.

*Note: I want to use a batch file for right now, at some point I will develop a desktop application for my tool but this is time sensitive.

EDIT I have been able to obtain and get PSEXEC put onto my computer so that could be an option as well. I have looked around online but really can only find help if just installing the software by itself. I know that it works in conjunction with msiexec.

I have the following but know I need more: psexsec \%id%\c$ cmd /c "c:\temp\vpn install" msiexec /i anyconnect-win-4.7.04056-core-vpn-predeploy-k9.msi /quiet /norestart

How would I call out the msi to be installed and install it in the process?

TIA

MjrPayne
  • 105
  • 1
  • 12
  • Got to a new point: c:\temp\psexec.exe "\\%id%\c$\temp\vpn install" -d -s cmd /c msiexec.exe /I anyconnect-win-4.7.04056-core-vpn-predeploy-k9.msi /quiet /norestart Now getting a new error that it cannot access the remote computer path. Is this maybe a permission issue? – MjrPayne Mar 12 '20 at 16:52

2 Answers2

0

Silence!: Installing silently using msiexec.exe


VBScript: I haven't tested this to be honest, but there is this sample here: Install Software on a Remote Computer (using VBScript). It seems to be the same script as on TechNet. I am used to distribution systems such as SCCM and the likes - hence no testing of this.

Options: You can use Active Directory to deploy "well-designed" MSI files using Group Policy Objects. I don't use this approach - again: no test environment. And there are logon scripts that can kick off installs from UNC paths (like the one above) and there are scheduled tasks - which can do the same.

Active Directory / GPO:

Some Links: (for easy retrieval)

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • Appreciate the suggestions. Unfortunately, I am in an evironment that really restricts alteration of current GPO's and our ability to run advanced scripts are limited, thus the use of a batch file as that seems to be my work around. I will look into your information however and see what I can build from that. Cheers – MjrPayne Mar 12 '20 at 14:32
0

So after a couple days of messing around with the scripting and way more google searches than I wanted to do, I finally got it to work. I ended up using the following

WMIC /Node:ComputerName process call create 'msiexec.exe /i \computername\path

This installed it without any error.

MjrPayne
  • 105
  • 1
  • 12
  • [Forgot to add a link to this - Powershell across the wire](https://stackoverflow.com/questions/46637094/how-can-i-find-the-upgrade-code-for-an-installed-msi-file/46637095#46637095). Not spot on, but just for reference. – Stein Åsmul Mar 13 '20 at 17:55