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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

command statements question

Status
Not open for further replies.

jleites

Programmer
Mar 1, 2003
41
0
0
US
Sorry for putting this question here, but I can't find a forum for DOS type batch command questions.

I'm running XP and put a few lines of command code in a batch file that I want to run at Windows Startup. The code works, but the problem is it opens a DOS window (which would show the commands if I hadn't included the Echo Off command). The DOS window is displayed until I manually close it. Is there a way to not show, or automatically close the window?
 
One way would be to run the batch file via a VBScript. Then you could set whether it is visible or not. Check the VBScript forum and search for WScript.Shell and .Run to find examples.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
There isn't an END command, but in the weird world of Microsoft, I found that START works. Instead of my last command just being the path to the program I want to run, I changed it to the START command, and the window now closes automatically. I'd like it not to show at all, but I can live with it closing.
 
Just for fun create a batch file and copy in the following. Open it and see what it does.

@echo off
set name=Joe Smith
set address=1 Main Street

echo %name%
echo %address%
@echo off
pause
end
 
end does nothing at all. If you want to REALLY test it, put it BEFORE the pause.

When I did that (without the echo off), the command processor gave the following message:
'end' is not recognized as an internal or external command, operable program or batch file.

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top