|
|
|
Click here to copy the following block |
Sub RunAtStartUp(ByVal Action As Integer, Optional ByVal AppTitle As String, _ Optional ByVal AppPath As String)
Const HKEY_CURRENT_USER = &H80000001 Const REGKEY = "Software\Microsoft\Windows\CurrentVersion\Run"
AppTitle = LTrim$(AppTitle) If Len(AppTitle) = 0 Then AppTitle = App.Title AppPath = LTrim$(AppPath) If Len(AppPath) = 0 Then AppPath = App.Path & IIf(Right$(App.Path, 1) <> "\", "\", _ "") & App.EXEName & ".Exe" End If
Select Case Action Case 0 DeleteRegistryValue HKEY_CURRENT_USER, REGKEY, AppTitle Case 1 SetRegistryValue HKEY_CURRENT_USER, REGKEY & "Once", AppTitle, _ AppPath Case Else SetRegistryValue HKEY_CURRENT_USER, REGKEY, AppTitle, AppPath End Select
End Sub |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|