Results 1 to 9 of 9

Thread: [RESOLVED] Activating .exe from VB6 service program.

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2017
    Posts
    8

    Resolved [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)?

  2. #2
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    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)

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2017
    Posts
    8

    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.

  4. #4
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,538

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 2017
    Posts
    8

    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!

  6. #6
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: [RESOLVED] Activating .exe from VB6 service program.

    Does it have to be a service ?
    Would a normal project without Forms do instead ?

  7. #7
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    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.

  8. #8

    Thread Starter
    New Member
    Join Date
    Jan 2017
    Posts
    8

    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.

  9. #9
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    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
  •  



Click Here to Expand Forum to Full Width