473,385 Members | 1,640 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Starting an application from a non-interactive windows service in windows 7

I have developed a windows service in VS 2008 which launches another application at my local computer. The launched application has a UI, so, I used CreateProcessAsUser API to launch the application (start the process).

Private Function CreateProcessAsUser(
ByVal hToken As IntPtr,
ByVal lpApplicationName As String,
ByVal lpCommandLine As String,
ByRef lpProcessAttributes As SECURITY_ATTRIBUTES,
ByRef lpThreadAttributes As SECURITY_ATTRIBUTES,
ByVal bInheritHandles As Boolean,
ByVal dwCreationFlags As UInteger,
ByVal lpEnvironment As IntPtr,
ByVal lpCurrentDirectory As String,
ByRef lpStartupInfo As STARTUPINFO,
ByRef lpProcessInformation As PROCESS_INFORMATION
) As Boolean

The application is running fine in windows xp but in windows 7, I got the privileges error i.e. the application launched by windows service is not running with ‘Administrator’ rights.

I have also tried ‘System.Diagnostics.Process’ and ‘ShellExecuteEx’ methods to launch my application with ‘Administrator’ rights from windows service, although the application is launched with ‘Administrator’ rights, but its running in background i.e. no UI is displayed on the current users desktop.

Please help me in this regard.

Thanks in advance.
Apr 6 '11 #1
0 940

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Albert Valls Rovira | last post by:
Hello all... I have created an application that accesses to a SQL server. When I execute it in my workplace it works perfectly, but if I install it to the end-user I get this message: Rrquest...
1
by: Nusret Bajric | last post by:
Hello, I have a problem with starting a COM application from my ASP.NET application on the server machine. I get an error with a message permission denied during creation of COM object. If I...
0
by: Barry | last post by:
Hi Sometimes when i "Start" an Web Application i see the message "Web Site Found, Waiting for reply" in Internet Explorer, and this seems to go on forever, most often i end up rebooting the...
1
by: SMichal | last post by:
Hi, how can I start new process with this kind of application ? C:\Direct.exe -a -b -c <C:\Script.src C:\log.txt As you can see...I'll start appliaction ConnectDirect with 5 paramaters ...
1
by: stuart | last post by:
Hi I'm trying to write a Python script to receive and save a file on a web server that has been POST'ed from a client application. In essence, this is similar to handling a file upload from an...
4
by: jeeji | last post by:
Hi I have a console application that in some cases could get a System.IO.FileLoadException Could not load file or assembly XXX, Version=5.0.0.0, Culture=neutral, PublicKeyToken=YYYY' or one of...
1
by: kevin.a.sweeney | last post by:
I would like to open an application from a hyperlink on a webpage. 1. the webpage is located on my local machine. 2. the application is located on my local machine. 3. the application will run...
4
by: timor.super | last post by:
Hi group, I have a strange error. I'm a beginner with dotnet 3.0, when i try to run an wpf application from my windows explorer, the application crash. For example, i've downloaded the demo...
3
by: bangeye | last post by:
Tribe, I have need to use ASP.NET to connect to an already running application (non web) that will be running on the same server as IIS. Start MyServerApp, MyServerApp is now running - doing...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.