Solved

Executing WinExec from a Win32 windows service

Posted on 2008-10-07
1
448 Views
Last Modified: 2013-11-20
I have been encountering a querky bug when executing WinExec from my win32 windows service. I am attempting to open IE Explorer 6 with the following command,

retCode = ::WinExec(command.c_str(), SW_SHOWNORMAL);
// The variable command contains the following value = "C:\\Program Files\\Internet Explorer\\iexplore" https:\\x.x.x.x

...but when I execute this, it starts iexplore in the task manager, but no browser opens up. Anyone have any thoughts on this? Very Urgent!!
T
0
Comment
Question by:rronec1
1 Comment
 
LVL 3

Accepted Solution

by:
Naveen_R earned 500 total points
ID: 22665695
This is because your service dosent have desktop interactivity permission. Right click on the service in the serive console window, take properties of your service-> Take Log on tab. In this tab, you can find a check box called "Allow service to interact with desktop". Enbale that option and try again.

One more thing I need to mention is that, you should not use WinExec function. It is provided only for compatibility with 16-bit Windows. Better use ShellExecute() function or CreateProcess() function.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MFC Dialog 9 49
Separate files macro - Errors on larger data set 18 69
conditional code and condition difference 9 82
JQuery serialize and unserialize 8 84
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question