launch application from service
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 3 of 3

Thread: launch application from service

  1. #1
    Join Date
    Jun 2008

    launch application from service


    what am I trying to make is a program that will allow "guest" to run an application as admin without asking for a password...

    runas.exe /savecred /u:admin asks for a password for the first run. Making a vbs file is not feasible because it sometimes lost its focus on a command prompt. registering "run as different user" from windows explorer will definitely ask for password too. I tried windows scheduler too...

    My last option left is running as service. I know that service has no gui. I coded a program that runs as service. Its task is to run 3rd party application... notepad.exe for example

    My service is running this program as "administrator" under guest account (I set it on services.msc). My program launches notepad.exe running as administrator but it wont show up on "guest" or currently logged user's desktop

    ShellExecute hwnd, "open", var_file , vbNullString, var_path, 1
    this code works well but it is hidden with currently logged user or guest.

    please help... thanks...
    Last edited by leetkrew; June 30th, 2012 at 01:53 AM.

  2. #2
    Join Date
    Jan 2006
    Fox Lake, IL

    Re: launch application from service

    Might be able to make it work with Windows 2000, but after that, I really doubt it. With each version, it gets harder. GUEST account has NO privileges, and cannot access other accounts. Make a USER account with minimal privileges instead.

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Jun 2005
    JHB South Africa

    Re: launch application from service

    I Personally don't like this idea.. and it opens up the PC for Malware attack.. The UAC is there for a reason, To Warn the user about ANY PROGRAM that is attempting to run as Administrator, If the user accepts it , then let it run..

    Like David put it ... Create a User Account with the required minimal privileges for the app to run, and use this account on the system...
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)