Here is a good reference:
Batfiles
Printable View
Here is a good reference:
Batfiles
I love to hang around on this page every time I need some Batch-Infos:
Rob van der Woude's scripting pages
Try this:
at the command prompt, type:
ECHO HPS(ALT+203) > reboot.com
(the (ALT+203) is entered by holding ALT, then typing 203 on the numeric keypad, looks like the outline of a short "T"))
You should have 4 characters being piped to the file reboot.com
If run in pure DOS, this handy bit-o-code restarts the whole computer.... BUT, if in a Win9X DOS shell, it will terminate the shell.
So your batch file then looks something like:
@echo off
blah blah
yakkity schmakitty
....
reboot
Do a search on www.askjeeves.com and you should find everthing that you need.
All other arguments aside, the answer is CLS. If you run a batch file from windows and it leaves you with the "Finished - autoexec.bat", a clear screen command at the end of the batch file will remove this screen.
REM Demo
ECHO This is a test.
CLS
--So says Polychronopolis..
Actually, that won't do it. That is what is displayed in the title bar in Windows.
Quote:
Originally posted by Polychronopolis:
All other arguments aside, the answer is CLS. If you run a batch file from windows and it leaves you with the "Finished - autoexec.bat", a clear screen command at the end of the batch file will remove this screen.
REM Demo
ECHO This is a test.
CLS
--So says Polychronopolis..
I'll promise you that CLS works in Win95. It is a tried and true method from batching installs of software. Though CLS is a Dos command to clear the screen, in a Dos window it will close the Finished window. I can't vouch for 98 and ME, but give it a try.
--So says Polychronopolis..
Ok, now I went home and tested the CLS command in Win98SE and WinME. Both worked wonderfully for closing out the window.
The answer to the original question IS "Put CLS as the last line of your batch file to close the window it is running in."
--So Confidently Says Polychronopolis..
You could write a batch file to exit to windows and place a call in the previous one just before the end command.
in order to run an appliction or batch file and close the launch window just use the start command.
---------------------------------------------
C:\>start /?
Starts a separate window to run a specified program or command.
START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
[/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
[/WAIT] [/B] [command/program]
[parameters]
"title" Title to display in window title bar.
path Starting directory
B Start application without creating a new window. The
application has ^C handling ignored. Unless the application
enables ^C processing, ^Break is the only way to interrupt
the application
I The new environment will be the original environment passed
to the cmd.exe and not the current environment.
MIN Start window minimized
MAX Start window maximized
SEPARATE Start 16-bit Windows program in separate memory space
SHARED Start 16-bit Windows program in shared memory space
LOW Start application in the IDLE priority class
NORMAL Start application in the NORMAL priority class
HIGH Start application in the HIGH priority class
REALTIME Start application in the REALTIME priority class
ABOVENORMAL Start application in the ABOVENORMAL priority class
BELOWNORMAL Start application in the BELOWNORMAL priority class
WAIT Start application and wait for it to terminate
command/program
If it is an internal cmd command or a batch file then
the command processor is run with the /K switch to cmd.exe.
This means that the window will remain after the command
has been run.
If it is not an internal cmd command or batch file then
it is a program and will run as either a windowed application
or a console application.
parameters These are the parameters passed to the command/program
If Command Extensions are enabled, external command invocation
through the command line or the START command changes as follows:
non-executable files may be invoked through their file association just
by typing the name of the file as a command. (e.g. WORD.DOC would
launch the application associated with the .DOC file extension).
See the ASSOC and FTYPE commands for how to create these
associations from within a command script.
When executing an application that is a 32-bit GUI application, CMD.EXE
does not wait for the application to terminate before returning to
the command prompt. This new behavior does NOT occur if executing
within a command script.
When executing a command line whose first token is the string "CMD "
without an extension or path qualifier, then "CMD" is replaced with
the value of the COMSPEC variable. This prevents picking up CMD.EXE
from the current directory.
When executing a command line whose first token does NOT contain an
extension, then CMD.EXE uses the value of the PATHEXT
environment variable to determine which extensions to look for
and in what order. The default value for the PATHEXT variable
is:
.COM;.EXE;.BAT;.CMD
Notice the syntax is the same as the PATH variable, with
semicolons separating the different elements.
When searching for an executable, if there is no match on any extension,
then looks to see if the name matches a directory name. If it does, the
START command launches the Explorer on that path. If done from the
command line, it is the equivalent to doing a CD /D to that path.
---------------------------------------------
---------------------------------------------
if you're using a batch files use Call command to run another batch..
---------------------------------------------
C:\>call /?
Calls one batch program from another.
CALL [drive:][path]filename [batch-parameters]
batch-parameters Specifies any command-line information required by the
batch program.
If Command Extensions are enabled CALL changes as follows:
CALL command now accepts labels as the target of the CALL. The syntax
is:
CALL :label arguments
A new batch file context is created with the specified arguments and
control is passed to the statement after the label specified. You must
"exit" twice by reaching the end of the batch script file twice. The
first time you read the end, control will return to just after the CALL
statement. The second time will exit the batch script. Type GOTO /?
for a description of the GOTO :EOF extension that will allow you to
"return" from a batch script.
In addition, expansion of batch script argument references (%0, %1,
etc.) have been changed as follows:
%* in a batch script refers to all the arguments (e.g. %1 %2 %3
%4 %5 ...)
Substitution of batch parameters (%n) has been enhanced. You can
now use the following optional syntax:
%~1 - expands %1 removing any surrounding quotes (")
%~f1 - expands %1 to a fully qualified path name
%~d1 - expands %1 to a drive letter only
%~p1 - expands %1 to a path only
%~n1 - expands %1 to a file name only
%~x1 - expands %1 to a file extension only
%~s1 - expanded path contains short names only
%~a1 - expands %1 to file attributes
%~t1 - expands %1 to date/time of file
%~z1 - expands %1 to size of file
%~$PATH:1 - searches the directories listed in the PATH
environment variable and expands %1 to the fully
qualified name of the first one found. If the
environment variable name is not defined or the
file is not found by the search, then this
modifier expands to the empty string
The modifiers can be combined to get compound results:
%~dp1 - expands %1 to a drive letter and path only
%~nx1 - expands %1 to a file name and extension only
%~dp$PATH:1 - searches the directories listed in the PATH
environment variable for %1 and expands to the
drive letter and path of the first one found.
%~ftza1 - expands %1 to a DIR like output line
In the above examples %1 and PATH can be replaced by other
valid values. The %~ syntax is terminated by a valid argument
number. The %~ modifiers may not be used with %*
--------------------------------------------
--------------------------------------------
Hope it helps
cripes, condor, is that an answer or is that an answer..!!!
;)
I'm pretty sure that was an answer!Quote:
Originally posted by Mr Myagi:
cripes, condor, is that an answer or is that an answer..!!!
;)
Great Condor, seems you still know your DOS commands, I forgot all mine heheh. But at least I know it's more than a "stupid black screen" ROFLMAO :D :D ;) ;)
Well, first time I've returned to this post since I first placed it several weeks ago! Looks like I'm not the only one who still uses batch files for automated installs and what not! Condor, thanks for the huge batch 'o info!
Here is a site with batch file paremeters <a href="http://www.cit.ac.nz/smac/msdos/msdos18.htm">http://www.cit.ac.nz/smac/msdos/msdos18.htm</a>
Here is a site with batch file paremeters
<a href="http://www.cit.ac.nz/smac/msdos/msdos18.htm">http://www.cit.ac.nz/smac/msdos/msdos18.htm</a>
<marquee>Good Luck!!</marquee>