0

is there a way to execute a command on Console2 from a VB.NET program?This is what i've tried, but doesn't seems to work. Thanks in advance.

Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Shell("console2.exe -r python script.py")

    Application.Exit()
End Sub

End Class
Code Newbie
  • 124
  • 1
  • 2
  • 10
  • can you call it directly from console? – Afriyandi Setiawan Feb 27 '15 at 03:49
  • @aphe , yes i can. But i want to make the program as the shortcut. so i do not need to type any command. – Code Newbie Feb 27 '15 at 03:51
  • it should be `console.exe` not `console2.exe` I think. And it should be in your environment variable path. – Pᴇʜ Mar 05 '15 at 07:25
  • @Peh i already renamed it to console2.exe and moved them into /Windows/System32 folder – Code Newbie Mar 07 '15 at 08:59
  • Try to use the full path to `console2.exe` even if in your `PATH`. Use full path to `python` and full path to `script.py` too. Make use of quotes too if there are spaces! E.g. `Shell("""c:/program files/console2.exe"" -r ""c:/python/python d:/data/script.py""")`. Note the double quotes within the string quotes. – Pᴇʜ Jun 16 '15 at 14:33

0 Answers0