Solved

edit regestry from app running as service

Posted on 2004-08-12
6
295 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 9

Accepted Solution

by:
_ys_ earned 500 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now