Results 1 to 7 of 7

Thread: [RESOLVED] NT Service [ntsvc.ocx] Account Setting

  1. #1

    Thread Starter
    Frenzied Member oceanebelle's Avatar
    Join Date
    Jun 2005
    Location
    my n00k.
    Posts
    1,064

    Resolved [RESOLVED] NT Service [ntsvc.ocx] Account Setting

    Hi Everyone,

    I have a problem about ntsvc.ocx.

    Although the program is running already, the service and all... the account that executed it is the system account.

    I have a part in it where it prints some data to the printer...
    the printer is from the network... etc etc.

    Now, previously I had some really weird problems regarding connecting to the printer.. and I have found out that there is no printer driver installed for the SYSTEM user.. only in my current user account.

    and since the service is run by the SYSTEM user, naturally there is no available printer for it.

    So the solution is either to install the driver to the System or make the Service run by the current user which has probably the right printer installed.

    Anyone please help badly... How do I go about both problems... ???

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: NT Service [ntsvc.ocx] Account Setting

    Shell another program from your service that prints the files immediately.

  3. #3

    Thread Starter
    Frenzied Member oceanebelle's Avatar
    Join Date
    Jun 2005
    Location
    my n00k.
    Posts
    1,064

    Re: NT Service [ntsvc.ocx] Account Setting

    Nevermind David, I've decided to change it to an app.. since there are problems with the printing object.. even if I changed the user.. and shell it. it seems the shelled application will act like a service too.. thus.. the Printer object printing methods won't work.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: NT Service [ntsvc.ocx] Account Setting

    You could have used the CreateProcessWithLogon. It can run a new process under a new username if you supply the password and domain and optionally load the users profile, but I dont think you need the profile. I mentioned it just in case.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    Frenzied Member oceanebelle's Avatar
    Join Date
    Jun 2005
    Location
    my n00k.
    Posts
    1,064

    Re: NT Service [ntsvc.ocx] Account Setting

    Naa.. given up on ntsvc... the one you suggested would only solve one of the problems... and it is not really a problem... but it is the Printing to a Networked Printer..

    I have a hunch that it is blocked by the SP2 firewall... and I was requested NOT to have too many settings to remember just to run the service. so. but I'm keeping the code. very useful

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: [RESOLVED] NT Service [ntsvc.ocx] Account Setting

    Yes, you never know when a particular code snippet will come in handy and if you cant remember how to write it all your out of luck. So either keep them all on your system or just dont forget to search VBF for it. I keep only a bit of code since most of the snippets are all over the forums including my own so no need to worrry about accidentally deleting my files, etc.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7

    Thread Starter
    Frenzied Member oceanebelle's Avatar
    Join Date
    Jun 2005
    Location
    my n00k.
    Posts
    1,064

    Re: [RESOLVED] NT Service [ntsvc.ocx] Account Setting

    Perhaps I should post it... I really liked that code.. and some people could make it better.

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