?
Solved

Hide dos prompt window while running a .bat file

Posted on 2005-05-17
10
Medium Priority
?
17,546 Views
Last Modified: 2009-11-05
I have a .bat file that starts a string of install files, but when I run it the dos prompt window opens. Is there any way to hide the dos prompt window while the batch file is running? I'm new to this.
0
Comment
Question by:kishfy
10 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 14021468
How are you lauching the dos prompt?
If you are doing programatically, you can use WinAPI's WinExec() function:

WinExec("Somebatch.bat", SW_HIDE)
0
 

Author Comment

by:kishfy
ID: 14021599
I'm just double clicking on the batch file. The dos window opens and the install windows pop up. I don't want the dos prompt window to stay open in the background though.
0
 
LVL 16

Assisted Solution

by:PaulCaswell
PaulCaswell earned 400 total points
ID: 14021608
1. Make an alias to the batch file.
2. Under XP, take properties of the alias and change the 'Run' property to 'Minimised'.

This process can also be done using a simillar under W95/98.

Paul
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:kishfy
ID: 14021650
How do I make an alias, how do I take properties of the alias and change the 'Run' property to 'Minimised'. Sorry I'm new to this stuff.
0
 
LVL 3

Accepted Solution

by:
Dawaffleman earned 300 total points
ID: 14021685
i think what he means by alias is a shortcut.
right click on the icon and select make shortcut.
right click on the shortcut and go to properties.
under the 'run' field select minimized.
double click on the shortcut to the batchfile to begin (not the original one).
0
 

Author Comment

by:kishfy
ID: 14021808
Thanks all. Patients for the rookies much appreciated!
0
 
LVL 28

Expert Comment

by:vinnyd79
ID: 14023977
Another way would be to launch it with a vbs file. Just add this to a text file and give it a .vbs extension. Then double click it.


Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.run "%comspec% /c C:\MyFile.bat",0
Set WshShell = Nothing
0
 
LVL 16

Expert Comment

by:PaulCaswell
ID: 14043796
Sorry for not getting back on this one! My e-mail has been down for a few days.

Thanks Dawaffleman for clarifying my clearly ultra-short solution. I worked with Apple Macs for a while and I still cant get away from Folders and Aliases to Directories and Shortcuts. Microsoft really work hard on making everyone really work hard dont they.

Paul
0
 
LVL 9

Expert Comment

by:Deathrace
ID: 25231632
hey vinnyd79:

your comment really worked for me...thank you

0
 

Expert Comment

by:renztech
ID: 25751724
ok Ive been also following this topic and attempting to do the same thing.
yes Vinnyd79 's solution DOES work NOW the NEXT Step:
How can we apply this script to ALL AD Logins??
 Here's my modified script:
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.run "%comspec% /c \\ad1\NETLOGON\master.cmd",0
Set WshShell = Nothing
ABOVE works like a champ..but now how can I use it to execute everyones login script when they login to the domain?
 
Thanks
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you don't know how to downgrade, my instructions below should be helpful.
Make the most of your online learning experience.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question