1.

Solve : Editing registery in Visual basic 5?

Answer»

Hi brothers!

i want to add a file in registery that when the computer boot that file get

executed for this purpose i have to use visual basic

Some one told me that to do this

Dim Reg As Object
Set Reg = CreateObject("wscript.shell")
' Suppose Write App to Startup with Computer
Reg.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN\" & App.EXEName, App.Path & "\" & App.EXEName & ".exe"


but when i use suppose pc.exe insted of "app" which is GIVEN above in

EXAMPLE the compiler gives the error "object required" . So sum one can

help me i want to write pc.exe file which is located on my D:\ drive that get

executed with comptuer start.

EXAMPLE SHOULD BE WITH PC.EXE so that i can understand it easily

Thankx brothers
The format of the RegWrite method is:

Code: [Select]WshShell.RegWrite strName, varValue [,strType]

The RegWrite method WRITES either a key or a value to the registry based on strName. If strName ends with a backslash (\), then RegWrite writes varValue to the registry as a key. Otherwise it writes varValue to the registry as a value.

This is hardcoded, but you should be able to resolve with the app. properties:

Code: [Select]Set Reg = CreateObject("wscript.shell")
Reg.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN\PC", "PC.EXE"

Not for nothing, but why not make a SHORTCUT to your file in the system startup folder? Just asking.

Hi sir,
I dont have words to explain my emotions . i worked. Thank you very very MUCH sir



Discussion

No Comment Found