473,396 Members | 1,784 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,396 software developers and data experts.

Process.Start in a windows service

I am trying to start a process from a windows service but when the process
starts the command window that the process runs in never shows. Is this
because I am calling it from a windows service? Is there something else
that I need to do?

Here is my code:

System.Diagnostics.ProcessStartInfo info = new
System.Diagnostics.ProcessStartInfo();

info.FileName = "DTSRun";
info.Arguments = server.ExeSyntax; //Arguments for dtsrun
info.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized;
System.Diagnostics.Process.Start(info);
Thanks

Dan Reber
Nov 15 '05 #1
4 25725

"Daniel Reber" <no****@nospam.com> wrote in message
news:uY**************@TK2MSFTNGP11.phx.gbl...
I am trying to start a process from a windows service but when the process
starts the command window that the process runs in never shows. Is this
because I am calling it from a windows service? Is there something else
that I need to do?

This because the Service runs in the context of a non interactive desktop,
if you start another process froms this parent process, the child will run
in the same non visible desktop.

What you could do (but I hate the idea because it opens a security hole as
big as the Ozon hole), is to set the service to interact with the desktop.

Willy.


Nov 15 '05 #2
That worked, thanks. What kind of holes? Is there any other way for a
windows service to start an executable that has UI?

Thanks for your help.

Dan.

"Willy Denoyette [MVP]" <wi*************@pandora.be> wrote in message
news:Ow**************@TK2MSFTNGP09.phx.gbl...

"Daniel Reber" <no****@nospam.com> wrote in message
news:uY**************@TK2MSFTNGP11.phx.gbl...
I am trying to start a process from a windows service but when the process starts the command window that the process runs in never shows. Is this
because I am calling it from a windows service? Is there something else
that I need to do?

This because the Service runs in the context of a non interactive desktop,
if you start another process froms this parent process, the child will run
in the same non visible desktop.

What you could do (but I hate the idea because it opens a security hole as
big as the Ozon hole), is to set the service to interact with the desktop.

Willy.

Nov 15 '05 #3

"Daniel Reber" <no****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
That worked, thanks. What kind of holes? Is there any other way for a
windows service to start an executable that has UI?

A lot of info can be found on MSDN about security and elevating security
privileges when running services in the interactive winstation ( start with
KB Q327618).

Willy.


Nov 15 '05 #4
I will look into it.

Thanks for your help.

Dan
"Willy Denoyette [MVP]" <wi*************@pandora.be> wrote in message
news:Oy**************@TK2MSFTNGP10.phx.gbl...

"Daniel Reber" <no****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
That worked, thanks. What kind of holes? Is there any other way for a
windows service to start an executable that has UI?
A lot of info can be found on MSDN about security and elevating security
privileges when running services in the interactive winstation ( start

with KB Q327618).

Willy.

Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Stephan Lux | last post by:
Hi all, I have developed a windows service with Visual Basic .NET which starts a file conversion tool via the commandline. The tool open the files (z.B. Word, Excel, Acrobat...) and prints them...
12
by: GTi | last post by:
I have small program that always must be running when a user is logged on. Since users can close this program I must create a program that always check if this program is running. So I created a...
4
by: Mrinal Kamboj | last post by:
Hi , Doubt may be bit trivial , but i wanted to know , what are the exact benefits derived while we run a background process as an NT service in windows , we can as well achieve the...
1
by: Bucky Pollard | last post by:
I have a web service that needs to create a batch file and call it (since there are no APIs for the functionality I am looking for). I am using the Process and ProcessStartInfo objects. When I try...
3
by: Jørn A. | last post by:
I'm working on a web based user interface for a job scheduling system (running scripts). The system is using a non-windows scheduler software, but it's installed and running as a windows...
0
by: Daniel | last post by:
C# windows service freezes on System.Diagnostics.Process.Start(info) When I launch PSCP from a C# windows service and launch pscp 0.53 there are no issues. but when I use C# windows service to...
5
by: Rob R. Ainscough | last post by:
I'm using the Diagnostics.Process approach to shelling out run the following: C:\Windows\System32\MSIEXEC.EXE /x {73F1BDB7-11E1-11D5-9DC6-00C04F2FC33B} /q ..FileName =...
6
by: uuyytt | last post by:
I have a Windows service from which I want to start Internet Explorer with a particular URL as an argument. I don't know why my code (shown below) doesn't work. I know that IExplore.exe starts as I...
4
by: Steven De Smet | last post by:
Hello, This is my first post. I searched on the internet for answers but I was unable to solve my problem. So I hope that you guy's can help me with my VB.NET problem I tried to create a...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.