Solved

edit regestry from app running as service

Posted on 2004-08-12
6
308 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
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!

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
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
Course of the Month4 days, 15 hours left to enroll

636 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