?
Solved

edit regestry from app running as service

Posted on 2004-08-12
6
Medium Priority
?
316 Views
Last Modified: 2010-05-02
hi   re http://www.experts-exchange.com/Programming/Q_21080185.html

i did the job by changing the registry proxy settings,  at specified times the correct proxy is updated     this works great no bugs fixed a few leaks  etc..    

now,  when running from VB the app updates the registry,  but   when running as service   the registry is not updated,,,

why is that...

thanks a bunch

sander
0
Comment
Question by:mokum95
6 Comments
 
LVL 22

Expert Comment

by:DarkoLord
ID: 11782138
What error(s) do you get?

Darko
0
 

Author Comment

by:mokum95
ID: 11782163
i dont get any errors i just see the registry is not updated i had the same issue when connecting to a dsn while running as a service,  i adjusted the db connection without a dsn,  that works now,  

heres the function

Public Function InternetOff()
regCreate_Key_Value HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Internet Settings", "AutoConfigURL", "http:\\proxy-europe.network.fedex.com"
Call CloseBrowser
End Function


this function works ( registry is updated) when running as a program,   but when running as a service the function does not work..

i really have no experiance  with apps running as a service so dont know any limitations,   i use the service to prevent user from terminating the app from ctrl+alt+del  while internet is on,  so user can use internet without any timer to change the proxy to incorrect
0
 
LVL 22

Expert Comment

by:DarkoLord
ID: 11782205
hmm set your program to display a return value of a regCreate_Key_Value so you can see what is the error number...

Darko
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 9

Accepted Solution

by:
_ys_ earned 2000 total points
ID: 11782396
> regCreate_Key_Value HKEY_CURRENT_USER, ...
By default a service is installed under the LocalSystem account. As such it doesn't have access to HKEY_CURRENT_USER.

Alter the service settings to run under a specific user account.
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 11782568
You can create another activeX exe to do the registry changes.

Call this activeX from your service

ALso make sure change this activeX exe to run as interactive user from the identity tab by
using dcomcnfg.exe
0
 

Author Comment

by:mokum95
ID: 11782843
cheers YS !

am running as local system,           just running as admin  and it works

yeeaaahaaaaah


thanks for the fast reply !

cheers

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question