Message box after you close a window

Microsoft Windows xp professional w/serv...
December 22, 2009 at 16:21:44
Specs: Windows XP
Can you make a message box appear after closing a file? Here's the code:

=================================================

@Echo off
echo.

echo f|xcopy /i /k /y "%programfiles%\CompanyName\ProgramName\file.cfg" "%programfiles%\CompanyName\ProgramName\fileBKUP.cfg"

echo f|xcopy /i /k /y "%systemdrive%\CompanyName\ProgramName\file.cfg" "%systemdrive%\CompanyName\ProgramName\fileBKUP.cfg"

echo f|xcopy /i /k /y "%systemdrive%\ProgramName\file.cfg" "%systemdrive%\ProgramName\fileBKUP.cfg"

if exist "%programfiles%\CompanyName\ProgramName\file.cfg" (
start notepad "%programfiles%\CompanyName\ProgramName\file.cfg"
) else (
if exist "%systemdrive%\CompanyName\ProgramName\file.cfg" (
start notepad "%systemdrive%\CompanyName\ProgramName\file.cfg"
) else (
echo file.cfg could not be found!

)
)

if exist "%systemdrive%\ProgramName\file.cfg" (
start notepad "%systemdrive%\ProgramName\file.cfg"
) else (
echo file.cfg could not be found!

)
)

echo msgbox"This text is here to instruct the end user of some instructions ",4096+48,"ProgramTile" a.vbs&a.vbs&del a.vbs


=================================

How can I make the VBScript box appear when closing the CFG file? I can run the batch silent so it stays running till they close the CFG but don't know how to make the message box appear when its closed.

Thanks!!


See More: Message box after you close a window

Report •


#1
December 22, 2009 at 17:03:08
You could add "/wait" to those start commands and then use msg:

start /wait blah blah
msg "%username%" blah balh blah

If you want you can also pipe into msg:

dir|msg "%username%"

It's only for short messages though, it will error out if the message is too long.


Batch Variable how to


Report •

#2
December 22, 2009 at 17:09:33
Also this:

 > a.vbs echo msgbox"This text is here to instruct the end user of some instructions ",4096+48,"ProgramTile"&start /wait a.vbs&del a.vbs

[edit]
It may be a better idea to have the vbs delete itself rather
than having the batch do it:

>a.vbs echo msgbox"This text is here to instruct the end user of some instructions ",4096+48,"ProgramTile"
>>a.vbs echo Set objFSO = CreateObject("Scripting.FileSystemObject")
>>a.vbs echo strScript = Wscript.ScriptFullName
>>a.vbs echo objFSO.DeleteFile(strScript)

start a.vbs

http://blogs.technet.com/heyscripti...


Batch Variable how to


Report •

#3
December 23, 2009 at 13:45:15
Thanks!!!!!!!! That was easy enough and it works AWESOME!

Thanks again and Merry Christmas :)


Report •

Related Solutions


Ask Question