Discussion Locked

how to close a batch file from W2k scrip

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Does anyone know how to execute a DOS file from within W2k, that will close the window after the program has been executed?

5 replies

by soreloser

Use Windows Scipt Host.

Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
Return = WshShell.Run("notepad " & WScript.ScriptFullName, 1, TRUE)

Put this into a file called MyScript.vbs (or whatever you would like to call it).
You can execute it from the command line by cscript MyScript.vbs, or wscript MyScript.vbs. This will open notepad with the contains for the MyScript.vbs file.

by rawright

Run the program from a batch file, using EXIT as the last line in the file. This should close the DOS window and restore the desktop.

This discussion is closed to new replies.