0

I'd like to copy an icon into the computer's startup folder from vb.net code.

skaffman
  • 398,947
  • 96
  • 818
  • 769
Jeff
  • 8,020
  • 34
  • 99
  • 157
  • 1
    I assume you really want to create a shortcut to your application in the startup folder, not just copy a .ico file, which would be pretty useless. – Dana Robinson Mar 30 '09 at 00:34

1 Answers1

2

You can find the Startup Folder using the Environment.GetSpecialFolder function and then use File.Copy to copy out the file.

Public Sub CopyIconFromStartup(iconName as String, target As String) 
  Dim path as String = Environment.GetSpecialFolder(SpecialFolder.Startup)
  path = IO.Path.Combine(path, iconName)
  File.Copy(path, target)
End Sub
JaredPar
  • 733,204
  • 149
  • 1,241
  • 1,454