I have been trying to figure out how to run command lines through my VB form, such as:
Shutdown
Start
Echo
Just random things, and I can't figure it out. Can someone explain to me how it works? Thank you.
Running Command lines.
Page 1 of 15 Replies - 810 Views - Last Post: 09 November 2009 - 06:45 PM
Replies To: Running Command lines.
#2
Re: Running Command lines.
Posted 09 November 2009 - 11:39 AM
Check out the System.Diagnostics.Process Class in the .Net Framework for this, and the ProcessStartInfo Class for providing arguments
#3
Re: Running Command lines.
Posted 09 November 2009 - 01:46 PM
Im sorry, i just started yesterday. Can you give me an example please? i didn't understand any of that...
For example:
I know that the command "Shutdown -s" will shutdown the computer. How to i make it so a button on my VB form runs that console command?
For example:
I know that the command "Shutdown -s" will shutdown the computer. How to i make it so a button on my VB form runs that console command?
This post has been edited by nawima93: 09 November 2009 - 02:23 PM
#4
Re: Running Command lines.
Posted 09 November 2009 - 03:46 PM
There's prob a better way, but try this:
System.Diagonistics.Process.Start("cmd.exe", "shutdown /s")
#5
Re: Running Command lines.
Posted 09 November 2009 - 04:29 PM
Thank you very much Six... i mean Shockin.
We have a problem though.
It opens up the command prompt, but doesnt run the command... Any idea why this is?
We have a problem though.
It opens up the command prompt, but doesnt run the command... Any idea why this is?
This post has been edited by nawima93: 09 November 2009 - 04:30 PM
#6
Re: Running Command lines.
Posted 09 November 2009 - 06:45 PM
Shell("Shutdown.exe")
Shell("c:\program.exe myvariabletopass")
or
System.Diagonistics.Process.Start("shutdown.exe")
System.Diagonistics.Process.Start("c:\program.exe myvariabletopass")
Shell("c:\program.exe myvariabletopass")
or
System.Diagonistics.Process.Start("shutdown.exe")
System.Diagonistics.Process.Start("c:\program.exe myvariabletopass")
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|