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

VBScript Welcome Message - Display Picture

Status
Not open for further replies.

Rubymoon

IS-IT--Management
Jul 7, 2008
13
CA
Ok, I got this script which looks into a file and display the welcome message into explorer, I tried adding a picture but i cannot get it to display, if someone could tell me how to display the picture I would be very grateful.

Here is my code, which i need a picture in.

____________________________________________________________

Set objFSO = CreateObject("Scripting.FileSystemObject")
strText = objFSO.OpenTextFile("\\server\logon$\wmessage.txt", 1).ReadAll

Set objExplorer = CreateObject _
("InternetExplorer.Application")

objExplorer.Navigate "about:blank"
objExplorer.width = 300
objExplorer.height = 400
objExplorer.ToolBar = false
objExplorer.StatusBar = false
objExplorer.Fullscreen = false
objExplorer.Left = 50
objExplorer.Top = 50
objExplorer.Visible = true
objExplorer.Document.Body.Style.Cursor = "wait"
Set objDocument = objExplorer.Document
objDocument.Open
objDocument.Writeln "<Body BGColor=#FFFFFF SCROLL=NO>"
objDocument.Writeln "</BODY>"
objDocument.Writeln strText
objDocument.Close
wscript.sleep 11000
objExplorer.Quit

________________________________________________________

Thank you so much.
Have a nice day.
 
You need to learn a little html is all. First off you are ending your body tag and then adding your text. Reverse that order. Next use the IMG tag to add your picture.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
I do not know what you are trying to do here exactly; however, I recently wrote a file backup script with similar code - which might help in your case.


Here is the code snippet from my script and Good luck!
Code:
Set objExplorer = CreateObject ("InternetExplorer.Application")

	With objExplorer
		.Navigate "about:blank"   
		.ToolBar = 0
		.StatusBar = 0
		.Left = (intHorizontal - 400) / 2
		.Top = (intVertical - 200) / 2
		.Width = 400
		.Height = 200 
		.Visible = 1
		.Document.Body.Style.Cursor = "wait"    			
        .Document.Title = "Backup script in progress"
        .Document.Body.InnerHTML = "<img src='<Image Path>' height=75 width=75>" & _
    		"<br>" & _
    		"Your backup is being processed. <br><br>This might take several minutes to complete."
	End With

'Conduct backup

	With objExplorer
		.Document.Body.InnerHTML = "Your backup is now complete."
		.Document.Body.Style.Cursor = "default"
	End With

Wscript.Sleep 7000
			
objExplorer.Quit

V/r,

SPC Key
United States Army
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top