title: Create a shortcut to a network connection in Windows 7
body: <p>I am looking for an automatic method to create a shortcut to a <strong>network connection</strong> in Windows 7.  I do not believe this is the same as a shortcut to a file.  </p>
  
  <p>I would prefer it to be in vb.net, but anything (VBS, PowerShell, etc...) would be fine.</p>
  
  <p>I came up with the following script, but it requires you to click yes.  </p>
  
  <pre><code>    Const CSIDL_CONNECTIONS = &amp;H31
  
      Dim objShell As Object = CreateObject("Shell.Application")
      Dim objConnectionsFolder = objShell.NameSpace(CSIDL_CONNECTIONS)
  
      For Each objConnection In objConnectionsFolder.Items
          If objConnection.name = "Local Area Connection" Then
              Dim colVerbs = objConnection.Verbs
              For Each objVerb In colVerbs
                  If Replace(objVerb.name, "&amp;", "") = "Create Shortcut" Then
                      objVerb.DoIt()
                  End If
              Next
          End If
      Next
      MsgBox("If the script ends too quickly then it doesn't finish.")
  </code></pre>
  
  <p>Any Suggestions would be greatly appreciated. </p>