시작프로그램 - Startup

VNote 2017.11.12 08:10:43 *: Public Class Form1
Dim username() As String

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim My_UserName As String = username(1)
Dim My_UserPath As String = "C:\Users\" & My_UserName & "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\1.txt"
Try
My.Computer.FileSystem.CopyFile("c:\1.txt", My_UserPath)
Catch ex As Exception

End Try
End Sub

Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
username = My.User.Name.Split("\")
End Sub
End Class

C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

 

 

 

  Dim StartMenuFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.StartMenu)

   Dim StartupFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.Startup)

 

 

 

C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp