2

Possible Duplicate:
Run a completly hidden batch file

How do I execute batch files at startup so that I won't see the cmd like black window. I have this batch file which I use to attach vhd file on startup:

  @echo off
SET TEMPFILE="%TEMP%\%RANDOM%.TXT"
echo SELECT VDISK FILE=X:\sap.vhd >%TEMPFILE%
echo ATTACH VDISK>>%TEMPFILE%
DISKPART /s %TEMPFILE%
del %TEMPFILE%

Is there anything I could do to make the execution invisible?

Wern Ancheta
  • 6,620

1 Answers1

3

One way you could achieve this easily is through VBS.

Create a VBS with the following content:

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

Now you can run wscript "[vbspath]" "[batchfile]" to execute it silently.