473,320 Members | 2,161 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,320 software developers and data experts.

Launching a hidden process as a different user.

I can't seem to launch a process as a different user and hide the
window as well. If i don't specify the user, my window launches
hidden. But when I specify a user, the executable.exe process
launches an empty dos prompt. How can i hide this window?

----------------------------------------------------------------------------------------------------------------------------------------------------------
System.Diagnostics.ProcessStartInfo tempProcess = new
ProcessStartInfo("executable.exe", parameters);

tempProcess.UserName = "username";
tempProcess.Domain = "domain";
System.Security.SecureString password = new
System.Security.SecureString();
foreach (char temp in encryption.getVal("password").ToCharArray())
{
password.AppendChar(temp);
}
tempProcess.Password = password;

tempProcess.UseShellExecute = false;
tempProcess.CreateNoWindow = true;
tempProcess.WindowStyle = ProcessWindowStyle.Hidden;

System.Diagnostics.Process handle = Process.Start(tempProcess);

Nov 5 '07 #1
0 1556

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

Similar topics

0
by: timandsuzi36 | last post by:
I have a WinForms App that is launching an Access 2003 db Reports program. I am using the System.Diagnostics.Process object to do so. I thought that I could pass my db connection string to Access...
5
by: Nick | last post by:
hi, all Recently, our server which is a windows service got a problem. This windows service will launch a process to process user's data each time when a user connection comes in. The problems,...
6
by: sebastien | last post by:
Hi I have an asp.net application that use Session variables. What I want to do is to launch an second instance of this application by a link inside the first application. The problem is: when I...
2
by: James N | last post by:
PROBLEM # 1: ----------------- I am trying to launch a website in IE on the server from a C#/ASP.NET web service. I am using the System.Diagnostics namespace and the Process class methods. The...
0
by: Scott Zabolotzky | last post by:
I'm using the following code to launch SIGNCODE.EXE to sign a CAB provisioning file from an ASP.NET app. When I run the code the exit code comes back as -1. I have not been able to determine what...
24
by: Alan M Dunsmuir | last post by:
What is the command (in Windows Forms VB.NET) which will cause the subject computer's default browser to launch, and display a specified Web page? -- Alan M Dunsmuir
1
by: Water Cooler v2 | last post by:
I have a Windows Service I am writing in C# and a set of, let us say three, other executables written in C# (mostly console applications). I want that the Windows Service must do so every few...
10
by: Simon Verona | last post by:
I've decided to store my help pages on a web site rather than deliver with my application (trying to reduce the size of the install files). The web site is sort of all ready to rock and roll. ...
12
by: Dilip | last post by:
Hi All I have a server based C# console application. This application must hide its console window when its launched out on the field. So I dutifully P/Invoke'd FindWindow/ShowWindow...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.