0

I have A batch file named x.bat, i need it to run y.bat invisibly This is x.bat

     @ECHO off
     echo CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False>invisible.vbs
     wscript.exe invisible.vbs y.bat

y.bat

     @ECHO off
     dir>good.txt
     pause

When i run x.bat it is creating invisible.vbs but it is not opening y.bat invisibly How to overcome this problem

Subhang Rapeti
  • 53
  • 1
  • 2
  • 6
  • Duplicate of http://superuser.com/questions/62525/run-a-completly-hidden-batch-file – anon582847382 Nov 03 '13 at 12:03
  • possible duplicate of [Windows XP or Vista: How can I run a batch file in the background (no windows displayed)?](http://stackoverflow.com/questions/298562/windows-xp-or-vista-how-can-i-run-a-batch-file-in-the-background-no-windows-di) – anon582847382 Nov 03 '13 at 12:05

1 Answers1

0

Solution 1: Modify your file.

Save this one line of text as file invisible.vbs:

CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False

To run any program or batch file invisibly, use it like this:

wscript.exe "C:\Wherever\invisible.vbs" "C:\Some Other Place\MyBatchFile.bat"

To also be able to pass-on/relay a list of arguments use only two double quotes

CreateObject("Wscript.Shell").Run "" & WScript.Arguments(0) & "", 0, False

Example: Invisible.vbs "Kill.vbs ME.exe"

Solution 2:

Use a command line tool to silently launch a process : Quiethidecon or hideexec.

anon582847382
  • 19,907
  • 5
  • 54
  • 57