Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Silent .bat/.cmd file (no window)

9,107 views
Skip to first unread message

Kevin

unread,
May 4, 2004, 9:15:22 PM5/4/04
to
Hi,

Is there any way to make a .bat or .cmd file execute without opening a
console window ? (shortcut/pif trick ?)

If not, is there at least a way to start it minimized ?

(The batch file quickly use the START command but it still opens a console
window for a short time)

Thanks.


Jeff Qiu [MSFT]

unread,
May 5, 2004, 5:19:55 AM5/5/04
to
Hi Kevin,

Thanks for posting!

My name is Jeff and I understand your issue to be:


Is there any way to make a .bat or .cmd file execute without opening a
console window?

If I have misunderstood your issue please let me know.

Based on my test, we may run it in a minimized window:

1. Right click the bat file you have created and choose to Send To >
desktop (create shortcut).
2. Right click the shortcut and choose properties.
3. Choose to Minimized from the Run: drop down box.
4. Press OK.
5. Now, run this batch file from this shortcut will get it minimized.

Hope this helps.

Please feel free to let me know if you have any further concerns or
questions regarding the issue.

Best Regards,

Jeff Qiu
Microsoft Online Partner Support
MCSE 2000, MCDBA, MCSA
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
>From: "Kevin" <ke...@nospam.com>
>Subject: Silent .bat/.cmd file (no window)
>Date: Wed, 5 May 2004 03:15:22 +0200
>microsoft.public.windowsxp.general

Ramesh [MVP]

unread,
May 5, 2004, 5:52:05 AM5/5/04
to
Kevin,

You can script it, and make the .cmd or a .bat run invisible.

Example:
---
Set WshShell = CreateObject("WScript.Shell")
cmds=WshShell.RUN("c:\main.bat", 0, True)
Set WshShell = Nothing
--

Setting intWindowStyle to 0 will hide the output window:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsmthrun.asp

--
Ramesh - Microsoft MVP
Windows XP Shell
http://www.mvps.org/sramesh2k
---------------------------------------
What You Should Know About the Sasser Worm and It Variants:
http://www.microsoft.com/security/incident/sasser.asp
---------------------------------------


"Kevin" <ke...@nospam.com> wrote in message news:uhU4x5jM...@TK2MSFTNGP11.phx.gbl...

Alex Nichol

unread,
May 6, 2004, 7:23:54 AM5/6/04
to
Kevin wrote:

>
>Is there any way to make a .bat or .cmd file execute without opening a
>console window ? (shortcut/pif trick ?)
>
>If not, is there at least a way to start it minimized ?

The trick is in setting up a Pif to a bat - by default one will be made
as a LNK. So start by making a shortcut to a known DOS program -
System32\command.com will do - right drag it to the desktop, take Create
Shortcut here. Then right click that (rename if desired) and take
Properties. On the Program page change the command line pane to refer
to your .bat, and in the Run pane select Minimised, check 'close on
exit'


--
Alex Nichol MS MVP (Windows Technologies)
Bournemouth, U.K. Al...@mvps.D8E8L.org (remove the D8 bit)

billy...@gmail.com

unread,
Aug 21, 2012, 8:45:13 PM8/21/12
to
start /b YOUR_COMMAND arg0 arg1

Hot-Text

unread,
Aug 22, 2012, 1:04:41 AM8/22/12
to
<billy...@gmail.com> wrote in message news:ebb48393-214c-4f42...@googlegroups.com...
> start /b YOUR_COMMAND arg0 arg1

DOS_COMMAND
/B Restarts your computer after optimization.

regedt32_COMMAND
/s Run regedt32 in Silent

We need to know WHO_COMMAND

So you can have the right
bat/.cmd in (MASM)
Microsoft Assembly Language
in the CMD file....

lorenz...@gmail.com

unread,
Jan 29, 2013, 6:29:10 AM1/29/13
to
> > start /b YOUR_COMMAND arg0 arg1
>
> DOS_COMMAND
>
> /B Restarts your computer after optimization.

Syntax
START "title" [/Dpath] [options] "command" [parameters]

/B : Start application without creating a new window. In this case
^C will be ignored - leaving ^Break as the only way to

Andy

unread,
Jan 29, 2013, 9:55:56 AM1/29/13
to
Can the bat file itself be put into your script so there is only one file ?

0 new messages