Problem of invoking a command line from ASP.NET 2.0?
- From: "Speech Lover" <vince_zwp@xxxxxxxxxxx>
- Date: Mon, 7 May 2007 19:08:06 -0700
Hi,
First of all thanks for any response!
I want to start a command line command from C# 2.0.
Since .net 2.0 provides a way to specify a particular credential in
ProcessStartInfo object to run the command line, I am able to impersonate a
particular user to run this command.
However, no matter how simple the command is, say invoking Notepad.exe, I
always got the following error messages:
System.ComponentModel.Win32Exception was unhandled
Message="The parameter is incorrect"
Source="System"
ErrorCode=-2147467259
NativeErrorCode=87
StackTrace:
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo
startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at WindowsApplication1.Form1.InvokeDosCommand() in C:\Documents and
Settings\vizhou\My Documents\Visual Studio 2005\Projects\WebSite1
(2)\WindowsApplication1\Form1.cs:line 50
at WindowsApplication1.Form1.button1_Click(Object sender, EventArgs
e) in C:\Documents and Settings\vizhou\My Documents\Visual Studio
2005\Projects\WebSite1 (2)\WindowsApplication1\Form1.cs:line 21
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&
m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&
msg)
at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at WindowsApplication1.Program.Main() in C:\Documents and
Settings\vizhou\My Documents\Visual Studio 2005\Projects\WebSite1
(2)\WindowsApplication1\Program.cs:line 17
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
.
- Follow-Ups:
- Re: Problem of invoking a command line from ASP.NET 2.0?
- From: MasterGaurav \(www.edujini-labs.com\)
- Re: Problem of invoking a command line from ASP.NET 2.0?
- Prev by Date: Re: ADFS and Classic ASP
- Next by Date: Could anyone provide a sample on using System.Diagnostics.Process with Domain, UserName and Password specified?
- Previous by thread: Re: ADFS and Classic ASP
- Next by thread: Re: Problem of invoking a command line from ASP.NET 2.0?
- Index(es):