|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Writing commands to cmd from VB.Net 2005Hi everyone. I hope that someone can help me.
I'm trying to start a command prompt from vb.net 2005 with newProc.Start("cmd.exe"). This works but then I want to write commands to the process. I have tried newProc.StartInfo.FileName = "cmd.exe" newProc.StartInfo.UseShellExecute = False newProc.StartInfo.redirectStandardInput = True newProc.Start() newProc.StandardInput.WriteLine("cd testmap") This does'nt work and when I use the redirectStandardInput the cmd-window disapear.
Show quote
Hide quote
"Nettan" <Net***@discussions.microsoft.com> wrote in message Sorry I don't know the specifics of how to code to CMD, but my first thought news:8918E3D2-D2B7-4C47-92B1-8E20E3582090@microsoft.com... > Hi everyone. I hope that someone can help me. > > I'm trying to start a command prompt from vb.net 2005 with > newProc.Start("cmd.exe"). This works but then I want to write commands to > the process. I have tried > > newProc.StartInfo.FileName = "cmd.exe" > newProc.StartInfo.UseShellExecute = False > newProc.StartInfo.redirectStandardInput = True > newProc.Start() > newProc.StandardInput.WriteLine("cd testmap") > > This does'nt work and when I use the redirectStandardInput the cmd-window > disapear. was to write out a batch file and execute that instead of redirecting standard input. Thanks, I tried with a batch-file instead and it works fine.
Show quoteHide quote "Robinson" wrote: > "Nettan" <Net***@discussions.microsoft.com> wrote in message > news:8918E3D2-D2B7-4C47-92B1-8E20E3582090@microsoft.com... > > Hi everyone. I hope that someone can help me. > > > > I'm trying to start a command prompt from vb.net 2005 with > > newProc.Start("cmd.exe"). This works but then I want to write commands to > > the process. I have tried > > > > newProc.StartInfo.FileName = "cmd.exe" > > newProc.StartInfo.UseShellExecute = False > > newProc.StartInfo.redirectStandardInput = True > > newProc.Start() > > newProc.StandardInput.WriteLine("cd testmap") > > > > This does'nt work and when I use the redirectStandardInput the cmd-window > > disapear. > > Sorry I don't know the specifics of how to code to CMD, but my first thought > was to write out a batch file and execute that instead of redirecting > standard input. > > >
ANN: .NET 3.0 Final
Attach handlers to ToolStripMenuItems. Got stacked, Please Help MDI gets FormClosing but non-Child forms also open do not. Error when laoding word from vb.net 2005 Multithread Design Question FOR SALE : Apple iPod 60GB,--------------------$150 Drawing help database selection in deployment Window Combo box Badly behaving child in MDI application |
|||||||||||||||||||||||