0

How Can I hide the console of a running batch file the batch is running from a cmd or start>run

3
  • You need to provide more info. what runs the batch file. Commented Oct 7, 2010 at 10:27
  • please give information about whats running it. and what type of batch file it is. Commented Oct 7, 2010 at 10:29
  • IF I run the Batch from cmd or double click or start>run not from a software or a development language (from Windows) Commented Oct 7, 2010 at 10:30

4 Answers 4

3

You can try a couple of things:

Schedule it with a user other than you.

or

CMD /C START /MIN your.CMD

or

This WSH/VBScript will run your batch file in a hidden window:

'MyCmd.vbs
Set WshShell = WScript.CreateObject("WScript.Shell")
cmd = "C:\bin\scripts\MyCmd.cmd"
Return = WshShell.Run(cmd, 0, True)
set WshShell = Nothing
Sign up to request clarification or add additional context in comments.

Comments

0

At the start of your batch file add these lines.

@echo off
if not defined PIL (
    set PIL=1
    start /min "" %~0
    exit /b
)

Replace the rest of your batch here

If PIL is not defined in your batch file then the batch file will restart itself minimized. If PIL is defined in your environment then change it to something else. This will restart the batch file with PIL defined as 1 and since PIL is defined it will skip the restarting section after the file has been restarted.

Comments

0

make a shortcut to the batch then right click and select properties now under the general tab there will be a run option click the arrow beside it and select minimized now click apply and ok now start the program and it will run in the background.

hope i helped you this is pretty much guaranteed to work on any bat file.

Comments

0

I use this software to code .exe apps and it has a command that can do this. The name of the software is Advanced Bat to Exe Converter but it doesn't only convert, you can code and compile them too. Try this coding once you download the program from here, this should also work with other exe compilers, but I am not sure.

@echo off
:menu
cls
color 9e
rem ChangeColor 14 0
rem ChangeColor 14 9
rem PrintBoxAt 6 11 15 60 1
rem PrintBoxAt 11 21 5 40 1
rem printcenter Enter window title: 13 14 9
rem getinput
set w=%result%
rem hidewindow "%w%"
goto menu

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.