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

message box

Status
Not open for further replies.

Briandr

MIS
Jul 11, 2003
177
US
Hi,

I need to incorporate a message box into a vbscript. The message box would not require a response from the user. There would be no yes/no or ok to click. The message box needs to be setup in a way so that it would not stop the script from running. I would need a timer tied into the code so the message box would close at an appropriate time. Someone in another forum suggested using a HTA. The code that is pasted below was hacked together. The original idea was to create a complied exe from AutoIT and use that as a message box. As I have explained to others I don't script. So I need help piecing this together if someone is willing.

Set Fso=CreateObject("Scripting.FileSystemObject")
Set WshShell=CreateObject("WScript.Shell")
Set objNetwork=CreateObject("Wscript.Network")
objNetwork.MapNetworkDrive "b:", "\\abcwaltps\software", False, "MYDOMAIN\myuserid", "mypassword"
strComputerName=wshShell.ExpandEnvironmentStrings("%computername%")
wshshell.CurrentDirectory="b:\xpsp3\"
FSO.CopyFile "b:\xpsp3\WindowsXP-KB936929-SP3-x86-ENU.exe", "c:\windows\temp\"
FSO.CopyFile "b:\xpsp3\SplashText.exe", "c:\windows\temp\"
sTEST = "300 150 50 50 16 -1 -1"'position of window. Look at the AutoIT Documentation for specifics
sTitle = """Windows XP SP3 Installation"" "
WshShell.Run "c:\windows\temp\SplashText.exe " & stitle & """MIS Support is installing windows security updates. This message will disappear when the installation finishes in about 45 minutes. This window can be moved so it does not get in the way. Please call the Help Desk at xx-xxxx if this window is still present after 45 minutes or if you have any questions."" " & "400 170 50 50 18 -1 -1" & vbcr
wscript.sleep 2700000
wshshell.Run "c:\windows\temp\WindowsXP-KB936929-SP3-x86-ENU.exe /quiet /norestart /log:c:\windows\temp\WindowsXP-KB936929-SP3-x86-ENU.log",0,True
FSO.CopyFile "c:\windows\temp\windowsxp-kb936929-sp3-x86-enu.log", "b:\xpsp3\Logs\" & strComputerName & ".txt"
Set FSO=nothing
objNetwork.RemoveNetworkDrive "b:"

Help is greatly appreciated. Thank you.
 
instead of a Msgbox() you wan try a WshShell.Popup, this has a 'timeout' option, so you can display the box for 5 seconds.....its is still modal though.

you can run WshShell.Run(Splashtext.exe, 1, False) which means you script wont wait for splashtext.exe to finish, it will carry on with your WshShell.Run KB909060.exe, 1, True.
Once your KB909060.exe has finished you could run something like:
WshShell.Run pskill.exe splashtext.exe /force...or some build in windows command which terminates processes

I Hear, I Forget
I See, I Remember
I Do, I Understand

Ronald McDonald
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top