Eric wrote:
> Does anyone have any suggestions on how to code a batch file to
> close window? Thanks in advance for any suggestions
Shenan Stanley wrote:
> Depends on what you have available to you and what you mean by 'to
> close window'.
>
> You can kill a given task (which would *close* any associated
> windows.) Is that what you want?
Eric wrote:
> Thank you very much for suggestions
> I mainly copy backup files into specific folders using batch file,
> which take a while for copying, and I would like to shut down
> windows after copying all files for backup.
> Do you have any suggestions on how to do it?
> Thank you very much for any suggestions
Shenan Stanley wrote:
> So you have a batch script that copies files (xcopy or copy command
> line command?) and you want the command prompt window to close when
> done?
> EXIT
>
> That would be the last line of your batch script.
Oh... Shutdown windows.
Before the "EXIT" command - put in the SHUTDOWN command in your batch
script.
Something like:
shutdown -s -c "Done with the Donuts" -t 60 -f
Should do it.
Usage: shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx]
[-c "c
omment"] [-d up:xx:yy]
No args Display this message (same as -?)
-i Display GUI interface, must be the first
option
-l Log off (cannot be used with -m option)
-s Shutdown the computer
-r Shutdown and restart the computer
-a Abort a system shutdown
-m \\computername Remote computer to shutdown/restart/abort
-t xx Set timeout for shutdown to xx seconds
-c "comment" Shutdown comment (maximum of 127 characters)
-f Forces running applications to close without
warning
-d [u][p]:xx:yy The reason code for the shutdown
u is the user code
p is a planned shutdown code
xx is the major reason code (positive
integer less than 256)
yy is the minor reason code (positive
integer less than 65536)
--
Shenan Stanley
MS-MVP
--
How To Ask Questions The Smart Way
http://www.catb.org/~esr/faqs/smart-questions.html