Ive wrote a small program to open at startup, but i want to give the user a chance to delete it from showing on startup by clicking a button. But it needs to be compatible on XP, Vista and Windows 7. Is there a line of code which will get the default startup folder path automatically so i can then delete it using my button?

Thankyou in advance,

Ross

cheers guys. I found it elsewhere. here is the code i used if anyone needs it

Dim startupfolder As String = Environment.GetFolderPath(Environment.SpecialFolder.CommonStartup)
        Dim path As String = startupfolder & "\" & "testing.txt"

        Try
            If System.IO.File.Exists(path) = True Then

                System.IO.File.Delete(path)
                MsgBox("File Deleted")
            Else
                MsgBox("File Not Deleted")
            End If
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
Comments
thanks for provided solution:)
This question has already been answered. Start a new discussion instead.