This is a script a use to allow my end users without admin rights install the Cisco VPN Client.
It has been tested with 4.8 but should work with newer versions such as 5.0
Just update the code with the account information for the admin account you want to install with.
As is the script should be run from the folder that contains the setup files.
You can also copy your PCF file (VPN Connection Settings) into that same folder, and the installer will automatically import it. You can call it anything you want as long as you keep the PCF extension.
Plain Text
Global $UserProf $UserProf = @UserProfileDir If $CmdLine[0] = 2 Then If $CmdLine[1] = "CopyFiles" Then $UserProf = $CmdLine[2] CopyFiles() Exit EndIf EndIf RunAsSet("Administrator", @ComputerName, "local admin password") $MSIRun = Run(@ComSpec & ' /C start /wait msiexec /i "' & @ScriptDir & '\vpnclient_setup.msi" /qb', @ScriptDir, @SW_MINIMIZE) Do $1 = WinWait("Cisco Systems VPN Client 4.8.00.0440", "Please wait while Windows configures Cisco", 5) $2 = ProcessExists($MSIRun) Until $1 = 1 OR $2 = 0 If $2 = 0 Then MsgBox(4096+48, "CWD Cisco VPN Installer", "The VPN client installation has failed" & @CR & "for an unknown reason") Exit EndIf $1 = 3 $2 = 3 Do $1 = WinWait("Cisco Systems VPN Client 4.8.00.0440", "You must restart your system", 5) $2 = ProcessExists($MSIRun) Until $1 = 1 OR $2 = 0 If $1 = 1 Then ControlClick("Cisco Systems VPN Client 4.8.00.0440", "You must restart your system", 3002 , "left") If FileExists("C:\Program Files\Cisco Systems\VPN Client\ipsecdialer.exe") Then RunWait(@ScriptFullPath & ' "CopyFiles" "' & $UserProf & '"') $Msg = MsgBox(4096+64+4+262144, "CWD Cisco VPN Installer", "The VPN client installation has completed however your computer" & @CR & "must be restarted before using using it." & @Cr & @CR & "Would you like to restart your computer now?") If $msg = 6 Then Shutdown(4+2) Else MsgBox(4096+64+262144, "CWD Cisco VPN Installer", "Please restart your computer before attempting to connect.") Exit EndIf Else MsgBox(4096+48, "CWD Cisco VPN Installer", "The VPN client installation has failed" & @CR & "for an unknown reason") Exit EndIf Exit Func CopyFiles() FileCopy(@ScriptDir & "\*.PNG", "C:\Program Files\Cisco Systems\VPN Client\Resources\*.*", 1) FileCreateShortcut("C:\Program Files\Cisco Systems\VPN Client\ipsecdialer.exe", $UserProf & "\Application Data\Microsoft\Internet Explorer\Quick Launch\CWD-VPN (Cisco).lnk", "C:\Program Files\Cisco Systems\VPN Client\", ' -c "CooperNAM (S)"', "", "C:\Program Files\Cisco Systems\VPN Client\Resources\connected.ico") FileCreateShortcut("C:\Program Files\Cisco Systems\VPN Client\ipsecdialer.exe", @DesktopCommonDir & "\CWD-VPN (Cisco).lnk", "C:\Program Files\Cisco Systems\VPN Client\", ' -c "CooperNAM (S)"', "", "C:\Program Files\Cisco Systems\VPN Client\Resources\connected.ico") EndFunc
Edited by ken82m, 11 October 2007 - 09:59 PM.





