-
Jan 4th, 2017, 03:15 AM
#1
Thread Starter
New Member
[RESOLVED] Activating .exe from VB6 service program.
Hi.
I've made a VB6 service program based on the code I found here:
http://www.freevbcode.com/ShowCode.asp?ID=4317
I've got the service up and running (I'm continously logging and saving to a .txt file atm) but I've run into a problem when using shell inside the service. It seems that I'm unable to run a shell command within the service, nothing really happens when the code gets to that point. I can see in my logs that I've done everything up to that point but the service just skips the shell command all together and then continous with the other code and starts over again.
So my question is how do I activate a .exe (with parameters) from a service if shell doesn't work (or is there a way to make shell command work)?
-
Jan 4th, 2017, 03:50 AM
#2
Re: Activating .exe from VB6 service program.
The program you downloaded was 2001
He (Sergey Merzlikin) has updated the program to 2004 -
http://www.smsoft.ru/en/ntservice.htm
That web page also has much more info
And he has an email address (near the bottom) that invited correspondence (mind you that was 2004)
Rob
PS He says this -
"The functional part of service (which is absent in this sample) must be driven by the events from Service Dispatcher. All events must be processed during few seconds, otherwise the service will be unable to respond on requests from Service Dispatcher."
Which may be related to your question ? (but what do I know)
-
Jan 4th, 2017, 05:28 AM
#3
Thread Starter
New Member
Re: Activating .exe from VB6 service program.
Thanks for the answer, I've updated so I use the slightly newer 2004 version but I still have a hard time understanding the service dispatcher part (how to use it in the code). But I've sent a mail to him, hoping that he still uses it even if it's been 13 years. Though if anyone have any direct input on how to use it I'd be more than glad to get an explenation.
Last edited by bikkebakke; Jan 4th, 2017 at 05:50 AM.
-
Jan 4th, 2017, 12:35 PM
#4
Re: Activating .exe from VB6 service program.
Because it's running as a service... it isn't running as part of the UI ... it's what allows services to run even when someone isn't logged into the computer. In order for the service to launch programs, it needs to interact with the Desktop Shell... Which is Q3 (and 4) in the Q&A at that last link. The service needs to be able to interact with the desktop, and then it needs to be turned on.
-tg
-
Jan 5th, 2017, 06:05 AM
#5
Thread Starter
New Member
Re: Activating .exe from VB6 service program.
Marking the thread as resolved.
There might be a way to circumvent all this and activate an .exe file from within a service but it feels like it's above my programming level right now. Still, thanks for the answers!
-
Jan 5th, 2017, 07:26 PM
#6
Re: [RESOLVED] Activating .exe from VB6 service program.
Does it have to be a service ?
Would a normal project without Forms do instead ?
-
Jan 5th, 2017, 10:29 PM
#7
Re: [RESOLVED] Activating .exe from VB6 service program.
I suspect he is trying to create a set of programs that bypass the UAC security prompts that warn users something "funny" is up.
In most cases the answer is to rewrite your programs to run properly with Standard User rights.
-
Jan 6th, 2017, 04:58 AM
#8
Thread Starter
New Member
Re: [RESOLVED] Activating .exe from VB6 service program.
A customer wants to have a program that takes product information from a database and then have it sent to them using an executable they created (basically me scanning my DB then sending that information via their .exe with parameters). It was them wanting a service, but I'm going to suggest just using the start task scheduler and hiding my program in the tray instead or something. Not as fancy but it should work at least.
-
Jan 6th, 2017, 07:55 PM
#9
Re: [RESOLVED] Activating .exe from VB6 service program.
If it runs all the time you could just get it to start with windows
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|