How to create an invisible batch file running on Windows OS


To create an invisible batch file, I mean if you don’t want to see the terminal window then it could be achieved by writing basic VBScript file.
There are two easy ways to call it by clicking on it or defining it as a Scheduled task on Windows OS.

First create a VBScript file and name the extension –> VBScriptfile.vbs

runBatchInvisible.vbs

Set WshShell = CreateObject(“WScript.Shell”)
WshShell.Run chr(34) & “C:\batchfiles\invisibleBatch.bat” & Chr(34), 0
Set WshShell = Nothing

And save this script under the folder name C:\batchfiles\runBatchInvisible.vbs
Create a batch file named invisibleBatch.bat under the folder C:\batchfiles\invisibleBatch.bat

@ECHO OFF

ECHO INVISIBLE BATCH FILE WORKS >> LOG.TXT
DIR C:\WINDOWS  >> LOG.TXT
PAUSE

After clicking on runBatchInvisible.vbs file you can see the output of the batch file inside LOG.TXT

sample output;

INVISIBLE BATCH FILE WORKS
 Volume in drive C has no label.
 Volume Serial Number is

..

Directory of C:\WINDOWS

16.05.2011  19:49    <DIR>          .
16.05.2011  19:49    <DIR>          ..
06.05.2011  13:57    <DIR>          ….

  455 File(s)     41.581.527 bytes
              52 Dir(s)  87.602.921.472 bytes free

Download Program

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s