Membuat StartUP program


Berikut ini adalah cara bagaimana membuat agak program bisa berjalan pada startup windows.

Cara membuat program berjalan pada startup

buat modul pada vb dengan nama mdlStartUp.
++++++++++++++++++++++++++++++++++++++++++

‘ketik pada module
‘— begin —

Public Sub DeleteKey(Folder As String)
On Error Resume Next
Dim b As Object
Set b = CreateObject(“Wscript.Shell”)
b.RegDelete Folder
End Sub

Public Sub CreateStringKey(Folder As String, value As String)
On Error Resume Next
Dim b As Object
Set b = CreateObject(“wscript.shell”)
b.RegWrite Folder, value, “REG_EXPAND_SZ”
End Sub

‘— end of modul

‘ketik pada code form
‘— begin —‘
Public sub StartUpOn(Status as boolean)
Dim letak As String
dim nama_folder_program as string

letak = App.Path & “\” & App.EXEName & “.exe”
nama_folder_program = app.EXEName

if status = True thens

‘Menulis keRegistri
CreateStringKey “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\” & nama_Folde_program & , “” & letak & “”

else

‘Menulis keRegistri
CreateStringKey “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run” & “\” & nama_folder_program ,””
DeleteKey “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run” & “\” & nama_folder_program

end if

end sub

‘— end of code —

‘pemanggilan
‘Buat 2 commandButton pada form

Private sub commandStartUpOn_Click()
StartUpOn True
end sub

Private sub commandStartUpOff()
startUpOn False
end sub

‘Tambahan, Jika ingin merubah RegisterOwner & RegistrerOrganization gunakan kode dibawah ini
‘tambahkan pada modul dibawah modul startup

‘— begin —
Public Sub CreateKey(Folder As String, value As String)
On Error Resume Next
Dim b As Object
Set b = CreateObject(“wscript.shell”)
b.RegWrite Folder, value
End Sub

‘— end of module

‘ketik pada form
‘contoh: pada saat form dijalankan

Private sub form_load()
dim myOrganization as string
dim myOwner as string

myOrganization = “Organisasiku”
myOwner = “Namaku”

CreateKey “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\RegisteredOrganization”, myOrganization
CreateKey “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\RegisteredOwner”, myOwner

end sub

‘— end of code —

About

Flexter member

Posted in VB 6.0
6 comments on “Membuat StartUP program
  1. Suwita says:

    kalau startup seperti billing di warnet gimana ya ?? biar komp dinyalain langsung muncul log-in seperti billing warnet?? tolong di bantu yach..

  2. kohimaru says:

    kode ini dibuat biar program berjalan diawal.
    ditambah dengan kode untuk always Ontop

  3. kohimaru says:

    nanti saya kirim via email

  4. dayat says:

    mas,sya mau nanya,sy org baru di vb.
    ko saya ga bisa nampilin helf ketika saya tekan f1?
    ditungggu jawabannya ya mas,
    makasih sebelumnya.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: