Results 1 to 3 of 3

Thread: Run Services In Registry

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Location
    Coventry
    Posts
    2

    Post

    I need to add a string to the rigistry that will start an app. The app is in c:\test\start.exe. How can i add this to the registry using VB6? or not even using vb6.

    Or any otherway to get the app to startup with windows other than c:\windows\startm~1\programs\startup

    Thanx.

  2. #2
    Guest

    Post

    You could use the WriteProFileString to add the line to the run part of the win.ini.

    Public Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long


    and in the project

    Call WritePrivateProfileString("windows", "RUN", "C:\test\start.exe", "C:\Windows\Win.ini")

  3. #3
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    For the registry: Use the Registry API functions, Aaron has an example at http://www.vb-world.net/ubb/Forum1/HTML/009026.html

    The place in the registry you would want to add it to is HKLM\Software\Microsoft\Windows\CurrentVersion\Run

    [This message has been edited by Clunietp (edited 12-29-1999).]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width