Question

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

Was it helpful?

Solution

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top