Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27514

VS 2010 Run Command Prompt and Execute Command

$
0
0
Ok, I want to run the command prompt from a click of a button. I have used the shell command but it returns an error.

I want to run the cmd.exe and execute a command like "jruby c:\users\desktop\filename.rb " & commandInput & " " & arg1 & " " & arg2 & ""

With the above command, you can see there are spaces, but I read something like the shell command won't read spaces if I use this:
Code:

shell("cmd /c jruby c:\users\desktop\filename.rb " & commandInput & " " & arg1 & " " & arg2 & "")
So, how would I be able to open the cmd prompt and execute that line of code within the cmd prompt?
Also I get an error when I press the button whilst using that command, I think it might be because of the spaces in between but I also try just shell("cmd.exe") and still gave me an error.

I'm a newbie at this.

Viewing all articles
Browse latest Browse all 27514

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>