Solved

edit regestry from app running as service

Posted on 2004-08-12
6
298 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

910 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

23 Experts available now in Live!

Get 1:1 Help Now