Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

edit regestry from app running as service

Posted on 2004-08-12
6
Medium Priority
?
312 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: 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!

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…
Suggested Courses

705 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