473,836 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Diagnost ics.ProcessStar tInfo info = new
System.Diagnost ics.ProcessStar tInfo();

info.FileName = "DTSRun";
info.Arguments = server.ExeSynta x; //Arguments for dtsrun
info.WindowStyl e = System.Diagnost ics.ProcessWind owStyle.Maximiz ed;
System.Diagnost ics.Process.Sta rt(info);
Thanks

Dan Reber
Nov 15 '05 #1
4 25778

"Daniel Reber" <no****@nospam. com> wrote in message
news:uY******** ******@TK2MSFTN GP11.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******** ******@TK2MSFTN GP09.phx.gbl...

"Daniel Reber" <no****@nospam. com> wrote in message
news:uY******** ******@TK2MSFTN GP11.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******** ********@TK2MSF TNGP09.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******** ******@TK2MSFTN GP10.phx.gbl...

"Daniel Reber" <no****@nospam. com> wrote in message
news:%2******** ********@TK2MSF TNGP09.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
1588
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 over an image printer driver to tiff-files. On my Windows XP client it works fine, but on the target system (Windows 2003 Server) some issues occured: My first release uses the framework process class to start the application. As a standalone...
12
4107
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 program in C# (my first!!) and it works with one major problem. This program detects when the desktop program is not running and starts it again. All works as expected BUT The desktop program is running as a SYSTEM user. That is not what I...
4
2388
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 functionality using standalone exe , which will keep on running in a loop and do the job till been messaged to stop . Essentially , i want the key advantages of implementing process daemons as an NT Service in windows .
1
5797
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 to call the batch file, it just returns with a return code of 1. When I call cmd.exe, and pass the batch file as a parameter it hangs. After much frustration and aggrevation, I found that CMD IS in fact running, but it is running under the context...
3
2576
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 service. The service is running with the credentials of a specified domain user, and all processes kicked off by the scheduler service runs with these credentials. In the web based interface I want to add a "Run" button for each job, making it...
0
849
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 launch pscp 0.58 C# freezes in System.Diagnostics.Process.Start(info)? pscp 0.58 works fine at command line, but causes C# to freeze on ystem.Diagnostics.Process.Start(info) also i noticed that the pscp process does not show in taske manager while...
5
7137
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 = "C:\Windows\System32\MSIEXEC.EXE" ..Arguments = "/x {73F1BDB7-11E1-11D5-9DC6-00C04F2FC33B} /q" ..Start() I do a WaitForExit and get an error code back from MSIEXEC of 1605 -- this
6
6501
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 can see it in my task manager, but it is not visible. Can anyone explain what is happening? My code: Process p = Process.Start("IExplore.exe", m_strURL);
4
8857
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 windows service that converts MS Word Files into .PDF files and after that we want to zip the .PDF files. Our code: Protected Overrides Sub OnStart(ByVal args() As String) ' Add code here to start your service. This method should set...
0
9813
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9665
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10541
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10584
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10248
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7782
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5645
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5817
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3108
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.