PDA

Click to See Complete Forum and Search --> : Run Services In Registry


Barron99
Dec 28th, 1999, 03:55 AM
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. :)

Dec 28th, 1999, 09:38 PM
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")

Clunietp
Dec 29th, 1999, 12:28 AM
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).]