Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

executing a batch file

Status
Not open for further replies.

kendas

Technical User
Feb 2, 2004
108
SG
hi,
how can i hide the DOS window when executing a batch file ?
thanks
 
Can you provide anything else? Like the OS you're using for the batch? Is the batch running from within another program you constructed?

If it's DOS (1.1-6.22) you won't be able to.
If it's Win (3.x) you'd have to modify the PIF.
if it's Win 9.x+ you'd have to modify the LNK.

--MiggyD
 
Like I said above, you have to modify the LNK file.

try creating a copy of CMD.LNK

[ul square]
[li]START > Programs > Accessories[/li]
[li]locate 'Command Prompt' or 'DOS Prompt'[/li]
[li]right-click on it and drag it to the desktop and select 'copy'[/li]
[li]edit the properties of the one you just copied where it says 'c:\winnt\cmd.exe' [/li]
[li]change it to something like:
'c:\winnt\cmd.exe [red]/c c:\yourBatch.bat[/red]' [/li]
[li]also change (if it shows) the 'run' window. If it says "normal window" change it to "minimized" [/li]
[li]save the changes [/li]
[li]run the program--it may be too fast to notice it worked.[/li]
[/ul]

try that and let us know of the results.
--MiggyD
 
theres way to do it but not from the command line....

if you run a batch file create a short cut to the batch file and right click on the shortcut and select properties.
under the properties, in the "run" catagory select "minimized" and exit saving your changes....when this short cut is next called it will run minimized.

if you have many sub batch files, in which you want all to run minimized, i would create shortcuts for all of them and "call" the shortcuts and not the bat files themselves.

hope this helps
chris castelein
shive-hattery
cedar rapids, ia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top