How to Make a Batch File Run Invisible

The batch file contains a series of commands executed by the command line interpreter. You can run a batch file invisible (hidden) without any software.

In this post, we will see the two methods to make a batch file run invisible. The first method is VBScript and the second method is DOS commands. Let’s get started.

Make a Batch File Run Invisible

VBScript

Steps

Let's create a batch file.

  • Type the following command in the Notepad
  • Start notepad

  • Save the file as example.bat. Make sure you’ve selected "All Files" in the "Save as type" option.

Using the following steps, you can create a VBScript file which will make this batch file hidden.

  • Type the following commands in the Notepad.
  • set w = CreateObject("WScript.Shell")

    W.Run chr(34) & "C:UsersRajDocumentsexample.bat" & chr(34), 0

    set w= Nothing

  • Replace the batch file path with yours. Save the file as hidden.vbs. Ensure you’ve selected "All Files" while saving the file.
  • Open the Command Prompt (Shortcut: open Run Command (Windows key + R) and type cmd).
  • Change the directory in the Command Prompt to the location where you saved the hidden file.
  • Now, type hidden.vbs.
  • VBScript execution in command prompt

That's all. The batch file should run invisible and it will open the notepad.

DOS Commands

Steps

  • You can use the same example.bat file for this method too. But, add the "Cls"(without quotes) at the last of the example.bat file.
  • Open the Command Prompt.
  • Change the directory to the location where you saved the batch file.
  • Type the following command
  • Start /b example.bat

    DOS command to make a batch file run invisible

Now, the batch file runs completely hidden and opens the notepad.

Run Batch File in Minimized Window

Alternatively, if you want to run the batch file in minimized window, you can use the following command in Command Prompt

Start /min example.bat

This will run the example.bat in a minimized screen.

I hope that the information in this post is useful to you. If you find the information in this post useful, share this post with your friends.​

Also see: