Search code examples
windowsbatch-filecmdstartup

Hide CMD Window for Batch File


I am using a batch file that, when clicked, opens a application after 10 seconds. Everything works fine but when I first click it the command prompt window comes up and sits there until the application opens. I do not want this; I want it to run in the background.

Here is my code

@echo off
rem sleeping for 10000 milliseconds (10 seconds)
ping -n 1 -w 10000 -4 10.0.0.0 >NUL

rem starting delayed start programs
start "" "C:\Program Files (x86)\WinSCP\WinSCP.exe"

Any ideas on how to keep that window from coming up?


Solution

  • Use vbscript. I'd include the code here but there are a lot of pages that cover this. Here's one: https://superuser.com/questions/62525/run-a-batch-file-in-a-completely-hidden-way