Hi, I just started coding again, and was wondering if it was possible to run a DOS command in vb6 without opening the cmd prompt. Basically Running a batch file within the form and not opening it in cmd prompt.
Im using this code to create and run a batch file, but i want it to load and execute in the form, not cmd prompt.
If that isnt possible, would i be able to execute my batch, and have it run in the cmd prompt, but have the cmd prompt hidden completely?Code:Private Sub Command1_Click() Open "c:\echo.bat" For Output As #1 Print #1, "@echo off" Print #1, "Echo Test Test Test" Print #1, "Ping 127.0.0.1" Print #1, "pause" Close #1 x = Shell("c:\echo.bat", 1) End Sub


Reply With Quote


Bookmarks