Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8190675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:43:47+00:00 2026-06-07T03:43:47+00:00

I only would like to call Process.Start(notepad.exe); when the service starts; But it doesn’t

  • 0

I only would like to call

Process.Start("notepad.exe");

when the service starts; But it doesn’t work at all. No notepad is called right after I chose to start the service in the windows service manager.

Thank you a lot.

[UPDATE]

I made it work after putting a check mark in logon tab to allow interactive desktop. But I don’t know what does this really mean ? How can I schedule to run a task on any computer if it always asks me to accept to view the message in the Interactive Desktop Detection panel ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T03:43:48+00:00Added an answer on June 7, 2026 at 3:43 am

    A Windows service is different from a standard process and by default it can’t interact with the user desktop(this is a rule of the Windows OS), so to launch a process and allow it to interact with the user desktop you have to flag the Interact with desktop option …

    Bear in mind that starting from Windows Vista services are running under session 0 and every time that the service try to start the process a panel is shown to the user the let the user choose if he wants to run the process or not; to overcome this limitation (panel that ask for confirmation) the only way is to launch the process from the service directly with the CreateProcessAsUser function of the Windows API …

    Take a look at this function that i have developed some times ago, that make use of the CreateProcessAsUser API, and start a process from a service without asking anything even in Vista/7:

        /// <summary>
        /// LaunchProcess As User Overloaded for Window Mode 
        /// </summary>
        /// <param name="cmdLine"></param>
        /// <param name="token"></param>
        /// <param name="envBlock"></param>
        /// <param name="WindowMode"></param>
        /// <returns></returns>
        private static bool LaunchProcessAsUser(string cmdLine, IntPtr token, IntPtr envBlock,uint WindowMode)
        {
            bool result = false;
    
            PROCESS_INFORMATION pi = new PROCESS_INFORMATION();
            SECURITY_ATTRIBUTES saProcess = new SECURITY_ATTRIBUTES();
            SECURITY_ATTRIBUTES saThread = new SECURITY_ATTRIBUTES();
            saProcess.nLength = (uint)Marshal.SizeOf(saProcess);
            saThread.nLength = (uint)Marshal.SizeOf(saThread);
    
            STARTUPINFO si = new STARTUPINFO();
            si.cb = (uint)Marshal.SizeOf(si);
    
            //if this member is NULL, the new process inherits the desktop
            //and window station of its parent process. If this member is
            //an empty string, the process does not inherit the desktop and
            //window station of its parent process; instead, the system
            //determines if a new desktop and window station need to be created.
            //If the impersonated user already has a desktop, the system uses the
            //existing desktop.
    
            si.lpDesktop = @"WinSta0\Default"; //Default Vista/7 Desktop Session
            si.dwFlags = STARTF_USESHOWWINDOW | STARTF_FORCEONFEEDBACK;
    
            //Check the Startup Mode of the Process 
            if (WindowMode == 1)
                si.wShowWindow = SW_SHOW;
            else if (WindowMode == 2)
            { //Do Nothing
            }
            else if (WindowMode == 3)
                si.wShowWindow = 0; //Hide Window 
            else if (WindowMode == 4)
                si.wShowWindow = 3; //Maximize Window
            else if (WindowMode == 5)
                si.wShowWindow = 6; //Minimize Window
            else
                si.wShowWindow = SW_SHOW;
    
    
            //Set other si properties as required.
            result = CreateProcessAsUser(
            token,
            null,
            cmdLine,
            ref saProcess,
            ref saThread,
            false,
            CREATE_UNICODE_ENVIRONMENT,
            envBlock,
            null,
            ref si,
            out pi);
    
            if (result == false)
            {
                int error = Marshal.GetLastWin32Error();
                string message = String.Format("CreateProcessAsUser Error: {0}", error);
                Debug.WriteLine(message);
    
            }
    
            return result;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to be able to spawn a linux process that would only
I would like to allow only one country access, but exclude proxies within this
I would like to only insert a row, if the following SELECT returns a
I would like to display only posts that are members of BOTH category 33,
I would like to store only .txt filenames from a specific dir (let's say:
I would like to extract only tar.gz from the following strings. /root/abc/xzy/file_tar_src-5.2.8.23.tar.gz or /root/abc/xyz/file_tar_src-5.2.tar.gz
I would like to have a tooltip that only comes up when you click
I would like to activate a .mouseover function only if the mouse lays down
I would like to display a line of text only if an object called
I would like to use a css selector to get only the th tags

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.