1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: HowTo run a batch file without it showing

Discussion in 'DOS/Other' started by kimsland, Oct 28, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. kimsland

    kimsland Thread Starter

    Joined:
    Oct 21, 2007
    Messages:
    1,102
    HOWTO RUN A BATCH FILE IN WINDOWS WITHOUT IT SHOWING:
    -----------------------------------------------------


    MINIMIZED:

    Start Run the following line, Replace the "MySubFolder" with your batch file path

    cmd /c "start /min C:\MySubfolder\MyBatchFile.bat"

    -----------------------------------------------------

    INVISIBLE:

    Save the following line as invisible.vbs (use Notepad Save As... All Files)

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

    Confirm you have Scripting installed (By typing wscript in the Start Run dialog)

    Start Run the following line, Replace the "MySubFolder" with your file paths

    wscript "C:\MySubfolder\invisible.vbs" "C:\MySubfolder\MyBatchFile.bat"

    -----------------------------------------------------

    RUNNING FROM CD: (using Environment Variables)

    "C:\Windows" can be replaced with "%windir%" (if your Windows path is unknown)
    "C:\MySubfolder" can be replaced with "%cdrom%" (if your batch file is on CD)
    "wscript" can be given the full path string - %windir%\system32\wscript.exe
    "cmd" can be given the full path string - %windir%\system32\cmd.exe

    CD EXAMPLES:

    Note:
    "MySubfolder" denotes your subfolder name
    "wscript.exe" exists in %windir%\system32
    "%CDROM%" you must be running this from CD

    Minimized:

    %windir%\system32\cmd.exe /c "start /min %CDROM%\MySubfolder\MyBatchFile.bat"

    Invisible:

    %windir%\system32\wscript.exe "%CDROM%\MySubfolder\invisible.vbs" "%CDROM%\MySubfolder\MyBatchFile.bat"

    -----------------------------------------------------

    Using Autoplay Menu Builder Program:

    Minimize:

    Program:
    %SysDir%\cmd.exe
    Parameter:
    /c "start /min %cdrom%\MySubfolder\MyBatchFile.bat"

    Invisible:

    Program:
    %SysDir%\wscript.exe
    Parameter:
    "%CDROM%\MySubfolder\invisible.vbs" "%CDROM%\MySubfolder\MyBatchFile.bat"

    -----------------------------------------------------

    Thanks To:

    This information has taken me hours (days!) of research
    With the help of ChuckE at http://forums.techguy.org
    and Eric at http://www.ericphelps.com/scripting

    -----------------------------------------------------

    You can find me floating around most good tech forums
    (I only wish I'd spent my time on Linux ! :)

    Kim
     
  2. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,731
  3. kimsland

    kimsland Thread Starter

    Joined:
    Oct 21, 2007
    Messages:
    1,102
    I had a good look at it.

    I was optimistic, I thought this would replace my command script, so my first thoughts were with good intentions.

    But...

    After using it I found that there is a very quick popup message (as stated by author) :
    "Quiet V01.01.00cpp Joe Richards ([email protected]) April 2002"
    Which is rather annoying

    Plus the sequence that it is using is exactly the same as the VBS file (provided) above, without the popup !

    Therefore users are better off Not using "Quiet"
    And staying with the above info.

    If anyone would like to reply with their thoughts, they are most welcome.

    Kim
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/644932