• 25,450
  • +1,014
  • 2,796
Invisibly Execute BAT File in the Background

Invisibly Execute BAT File in the Background

Bookmark

The story above is my personal experience while dealing with BAT script. A hacker also sometimes need to hide their script in the background, because they don't want the victim become suspicious if something popped out in their window, since any command prompt window will be visible until the .BAT/.CMD file execution is complete.

Requirement:

1. Notepad or any other text editor

How to Invisibly Execute BAT File in the Background:

1. Let say I will ping google.com by utilizing BAT script.

ping www.google.com

and then save as ping.bat

2. When we double click the ping.bat we've just created, a command prompt window will popped out and pinging google.com.

Invisibly Execute BAT File in the Background

and the window will automaticaly closed after the execution is complete.

3. We will utilize Windows Script Host RUN method to invisibly execute BAT file in the background. This is the script

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "
C:\ping.bat" & Chr(34), 0
Set WshShell = Nothing

Invisibly Execute BAT File in the Background

save the script as hidden.vbs with .vbs extension.

4. I've modified the BAT script a little bit, because we need to check whether the script was successfully executed or not.

ipconfig > result.txt

all IP configuration result will be saved into result.txt file.

5. When we execute the hidden.vbs, no window popped out and if our script was successfully executed in the background, in our folder location should have a new file result.txt contained with information about windows ip configuration.

Hope it's useful 🙂

Share this article if you found this post was useful:

Blogger at hacking-tutorial.com. Love PHP, offensive security and web. Contact him at me[-at-]vishnuvalentino.com

See all posts by || Visit Website : http://www.vishnuvalentino.com

  • akshayee

    Hi,

    Courtesy of some old good scripter, using an vbs script which displays cmd prompt window in foreground for executing the task of pinging several ip’s for getting their ping status, could you help in making this cmd window run minimized, thus not obstructing normal work on pc

    Many thanks and regards in advance,
    akshayee

    • v4L

      #akshayee
      you can use the method above by using bat file and hide the bat execution using vbs.

    • sumanth

      hlp me akshay……………..

  • jailman

    A Chinese American? You kidding me? Where are the White Americans?

  • sumanth

    mereko hlp karo.mereko kaisa fb hack karneka malum nahi…..plz dhosth

  • °ღ•℘ℛℐŶÁ●•٠·˙ °ღ•ÐÚßΞŶ●•٠·˙

    Hi,

    I would like to learn ethical hacking may I know from where i should start. Kindly clear my confusion.
    Thanks & Regards.
    Priya Dubey

  • hi,
    i would like to learn ethical hacking
    thank you
    seikosta.