Hi,
Is there any way to delete certian VPN XML profiles by AnyConnect using some "on connect" scripts or might some other method for Windows OS? I have tried "onconnect" vbs script but it seems not working. I suspect admin rights are required to perform delete action.
ON ERROR RESUME NEXT
Err.Clear
Set objShell = CreateObject("WScript.Shell")
objShell.LogEvent 0, "Delete vpn.xml file on first time connect OnConnect script."
Set obj = createobject("Scripting.FileSystemObject")
Dim filename
filename="C:\ProgramData\Cisco\Cisco Secure Client\VPN\Profile\vpn.xml"
obj.DeleteFile filename
Set obj=Nothing
If Err.Number <> 0 Then
objShell.LogEvent 0, "Failed to delete autopilot.xml" & vbCrLf & Err.Number & ": " & Err.Description
End If
WScript.Quit