Execute a system command: Difference between revisions
Content added Content deleted
Alextretyak (talk | contribs) (Added 11l) |
(VB.Net system command execution) |
||
Line 1,954: | Line 1,954: | ||
End Sub</lang> |
End Sub</lang> |
||
=={{header|Visual Basic .NET}}== |
|||
{{works with|Visual Basic .NET|9.0+}} |
|||
<lang vbnet>Module System_Command |
|||
Sub Main() |
|||
Dim cmd As New Process |
|||
cmd.StartInfo.FileName = "cmd.exe" |
|||
cmd.StartInfo.RedirectStandardInput = True |
|||
cmd.StartInfo.RedirectStandardOutput = True |
|||
cmd.StartInfo.CreateNoWindow = True |
|||
cmd.StartInfo.UseShellExecute = False |
|||
cmd.Start() |
|||
cmd.StandardInput.WriteLine("dir") |
|||
cmd.StandardInput.Flush() |
|||
cmd.StandardInput.Close() |
|||
Console.WriteLine(cmd.StandardOutput.ReadToEnd) |
|||
End Sub |
|||
End Module |
|||
</lang> |
|||
=={{header|Wart}}== |
=={{header|Wart}}== |
||
<lang wart>system "ls"</lang> |
<lang wart>system "ls"</lang> |