473,587 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Diagnost ics.ProcessStar tInfo tempProcess = new
ProcessStartInf o("executable.e xe", parameters);

tempProcess.Use rName = "username";
tempProcess.Dom ain = "domain";
System.Security .SecureString password = new
System.Security .SecureString() ;
foreach (char temp in encryption.getV al("password"). ToCharArray())
{
password.Append Char(temp);
}
tempProcess.Pas sword = password;

tempProcess.Use ShellExecute = false;
tempProcess.Cre ateNoWindow = true;
tempProcess.Win dowStyle = ProcessWindowSt yle.Hidden;

System.Diagnost ics.Process handle = Process.Start(t empProcess);

Nov 5 '07 #1
0 1567

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

Similar topics

0
2536
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 using the Process.StartInfo.Arguments with the /cmd switch like so. System.Diagnostics.Process i = new System.Diagnostics.Process();...
5
2886
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, once our service lanunches about 50 process, it starts to get errors say got an unexception or the process exe failed to initialized properly. I am...
6
1548
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 launch the second application, this second application override the session variables values of the first application. I can run 2 instances of my...
2
1166
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 IE process DOES seem to be running (since there are IExplore.exe entries in the Task Manager), but no matter what I do, there is no window on the...
0
1694
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 this exit code means (other than Error, as the CAB file does not get signed). No exceptions are thrown and I've verified that the app can read...
24
2071
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
1727
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 seconds: Check to see if each of the other executables are running or not. If they are not running, it should load them. For this purpose, I am...
10
1211
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. How from VB.net do I launch an internet explorer window, but making the window menuless, button and address bar less etc) and open the url for the...
12
6523
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 combination to hide the console window at launch time. The application (for legacy reasons) hangs around by waiting on an old- fashioned...
0
7843
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...
0
8206
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7967
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...
0
8220
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...
1
5713
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...
0
3840
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...
0
3875
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
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...

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.