Author Options:

Batch file programming help Answered

Hi, I've been recently working on a batch file program that can multitask, and open and close various programs on command. Currently, the main interface file is called "DBat"(without the quotes, and its a batch, so I guess its really DBat.bat). The folder it is in is on my Desktop, and called "DBat"(no quotes) I would like to make it so that when I open the folder, it automatically runs DBat. How would I do this? To explain it clearer:
I open the DBat folder
DBat.bat runs
Anyone know how I should go about this?


You could either:

1. Place a shortcut of the batch file in the startup folder
2. you could create a shortcut to a batch file that both explores the specified file and starts the batch file. You could also change the icon of the shortcut to a folder to make it look more realistic.


@echo off
%SystemRoot%\explorer.exe "FOLDER PATH HERE"

This will:
Start Dbat.bat and
Open up the folder you specified so you can explore it.

It will have the illusion of starting the batch while opening the file but really it will be starting a batch file.