Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

Hey,

 

I'm just messing around in visual studio and I've been trying to get an app to run cmd with some arugments without flashing up a cmd window. This is what I've got but I cant seem to get it working. If any one has any suggestions that would be awesome.

 

Dim startInfo As New ProcessStartInfo With { .FileName = "cmd.exe", .Arguments = TextBox2.Text & " exit", .WindowStyle = ProcessWindowStyle.Hidden } Process.Start(startInfo)

Posted

I found a way to do what I wanted by pumping the commands into a batch file and then running the batch file from a vbs file. The app runs the vbs file so no window pops up, and then the vbs file runs the batch file hidden, example of the vbs file below;

 

CreateObject("Wscript.Shell").Run "cmd.bat", 0, False

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...