• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 17558
  • Last Modified:

Hide dos prompt window while running a .bat file

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
kishfy
Asked:
kishfy
2 Solutions
 
Jaime OlivaresSoftware ArchitectCommented:
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
 
kishfyAuthor Commented:
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
 
PaulCaswellCommented:
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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
kishfyAuthor Commented:
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
 
DawafflemanCommented:
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
 
kishfyAuthor Commented:
Thanks all. Patients for the rookies much appreciated!
0
 
vinnyd79Commented:
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
 
PaulCaswellCommented:
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
 
DeathraceCommented:
hey vinnyd79:

your comment really worked for me...thank you

0
 
renztechCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now