M
micahstrasser
I have been trying for days to send a command to the command prompt
through the shell() function in vb.net. For some reason it is not
working. Here is the code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim command As String
command = "systeminfo > C:\temp\sysinfo.txt"
Shell(command, AppWinStyle.MaximizedFocus)
'Process.Start(command)
End Sub
As you can tell I have tried it with Shell() and process.start(). I
have also tried to use double quotes throughout different parts of the
string. When the code executes the command window flashes but the file
is not created. When I paste the command in the command window
everything works fine. Can anyone help?
through the shell() function in vb.net. For some reason it is not
working. Here is the code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim command As String
command = "systeminfo > C:\temp\sysinfo.txt"
Shell(command, AppWinStyle.MaximizedFocus)
'Process.Start(command)
End Sub
As you can tell I have tried it with Shell() and process.start(). I
have also tried to use double quotes throughout different parts of the
string. When the code executes the command window flashes but the file
is not created. When I paste the command in the command window
everything works fine. Can anyone help?