473,583 Members | 3,386 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error starting process as another user

Every thing work fine when I am not starting process as another user.

When I am starting process as another user, the authentication is
working (I can see it in my workstation security log), but I always
got the error: System.Componen tModel.Win32Exc eption "invalid
descriptor" at line 20

any idea?
------------------------------------------------------------------------------------------------------------------------------------------------------
01 Dim command As New System.Diagnost ics.ProcessStar tInfo("C:
\Travail\Pcount er\account.exe" )
02 Dim crptPassword As New System.Security .SecureString
03 Dim execcmd As System.Diagnost ics.Process
04 Dim resultat As System.IO.Strea mReader
05
06 command.UserNam e = "user"
07 command.Domain = "domain"
08
09 For Each unChar As Char In "psw"
10 crptPassword.Ap pendChar(unChar )
11 Next
12
13 command.Passwor d = crptPassword
14 command.Argumen ts = "viewbal " + txbCIP.Text
15 command.Redirec tStandardOutput = True
16 command.WindowS tyle = ProcessWindowSt yle.Hidden
17 command.UseShel lExecute = False
18 command.Working Directory = "C:\Travail\Pco unter\"
19
20 execcmd = System.Diagnost ics.Process.Sta rt(command)
21 resultat = execcmd.Standar dOutput
22 execcmd.WaitFor Exit(2000)
23 If execcmd.HasExit ed Then
24 lblResultat.Tex t = resultat.ReadTo End
25 End If
------------------------------------------------------------------------------------------------------------------------------------------------------

Sep 27 '07 #1
0 1276

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

Similar topics

12
2905
by: serge calderara | last post by:
Dear all, I have an application which is suppose to start another executable process. As soon as that process is running, I need to retrive its handle. The problem of the particular process I am starting is that it has a welcome window first which gets displayed and then the real windows after a while,in other words it means that the...
4
3717
by: Patrick Masson | last post by:
Hello, Our configuration : Apache 2.0.53 PHP 5.0.4 PC Windows 2000 MATLAB 6.1 We work on a consulting project in France which involves MATLAB Web server,
3
1955
by: Christopher | last post by:
One of our ASP.NET Pages is starting a new Process using the Process object. When the process starts, it is started under the ASPNET User. We tried editing the web.config file and the machine.config to operate under other user accounts but our dynamically started process still starts under ASPNET. How do you programatically start a process...
4
2937
by: Phil Mc | last post by:
Say for example you have a application running on a windows 2003 server (that is on server, not from). This application needs to start child applications (must be stand alone console applications), but these child applications must have the same security privileges as the parent starting them. I have created a scheduling app (which will be...
8
55672
by: Kevin D. | last post by:
Please note, I already posted this on the MySQL official forum, but received no response. I thought I'd try again in another location. My apologies to anyone reading this twice... Despite everything I've tried, I cannot get MySQL to start as a Windows service. However, I AM able to get it started via the mysqld-nt --console command. Here...
1
5363
by: abcd | last post by:
I am using Python to create a process on another computer. Both computers are on the same domain with admin privileges. On computer B I have a batch script which starts a python script. From computer A I am doing the following: import wmi w = wmi.WMI("1.2.3.4") p = w.new("Win32_Process") pid, retVal =...
1
2444
by: whitehorse | last post by:
When the warehousecontroller service is invoked, the following error message is sent to the application log: Event Type: Error Event Source: TFS Warehouse Event Category: None Event ID: 3000 Date: 4/14/2006 Time: 2:41:08 PM User: N/A
7
1870
by: tim | last post by:
Hi all, I want to execute a VB application from a ASP page (not .Net). Want I want to do is that I write some parameters to a database and then start the external application that will pickup these parameters and run in the background. I looked for a sample but I can't find any. Who can help me. Many thanks Tim
10
6951
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration of section c. Not sure where went wrong as the web page displayed internal server error. Also, what is the error 543? and error 2114....
0
8172
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. ...
0
8320
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...
1
7929
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
6577
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5370
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3814
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
3841
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2328
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1152
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.