I'm writing an application in VB.net that creates and calls batch files. I'd like these batch files to run hidden, but since there will be no shortcuts for the files, I would need to set this in the batch code itself. How would I do this?
Asked
Active
Viewed 3,407 times
1
-
See [this](http://superuser.com/questions/62525/run-a-completly-hidden-batch-file). – Laf Feb 24 '12 at 16:57
1 Answers
2
the vbs script in the link looks good, but if you are calling the batch files from the VB app then you can run the batch files hidden:
Dim p As New Process()
p.StartInfo.FileName = "cmd.exe"
p.StartInfo.Arguments = "/C mybatchfile.bat"
p.StartInfo.CreateNoWindow = True
p.StartInfo.UseShellExecute = False
p.Start()
p.WaitForExit();// this line waits for the batch to finish, remove if you want to start the batch and continue your app while it runs.
Martyn

SmithMart
- 2,731
- 18
- 35