我只是想触发一个将程序复制到 Startup 文件夹的事件。我不明白我哪里出错了?我不断收到异常消息。正在复制的文件未在使用中。
Try
Dim DesktopLink As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
Dim StartupFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.Startup)
Dim info As New FileInfo(StartupFolder)
info.CopyTo(DesktopLink + "\doessomething.bat")
Catch ex As Exception
MessageBox.Show("Error: Can not copy to startup folder")
End Try