Kathir Subramaniam
Kathir Subramaniam

Reputation: 1245

Hide Command Prompt Window on Startup till start time end

I am creating a windows application as a startup application. It will be started automatically on system startup. I want to delay the start time of my application for 5 minutes. For this i have created a custom script with below code and placed it in 'startup' folder.

@Echo off
TIMEOUT /T 300
start /b /d "{application path}" application

It will launch the application immediately after delay time completed. At this time command prompt window is appearing as below.

enter image description here

But for my requirement, this command prompt window must be hidden. How to do this?

Upvotes: 2

Views: 2061

Answers (2)

Kathir Subramaniam
Kathir Subramaniam

Reputation: 1245

Instead of using batch file, i have created a console application to start my application. Placed this console application in 'startup' folder. It automatically triggered and launched the application on system startup.

Upvotes: 0

user6017774
user6017774

Reputation:

Use a vbscript to do this.

wscript.sleep 300000
CreateObject("wscript.shell").Run "C:\folder\file.exe"

You have to use above function to hide a command prompt - you may as well put the timeout into the vbs script. One less file.

Upvotes: 1

Related Questions