I need a Vbscript that should open a image file from my PC and after some minutes that will get close automatically. I am planning to run the script through Command prompt any help is much appreciatable.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It might be easier to do this with an HTML Application rather than plain VBScript. Here’s a sample HTML app that display an image in a popup window that automatically closes after 5 seconds (you didn’t say whether you needed to have the image name and the timeout parameterized, so I assume they are predefined and can be hard-coded):
Simply paste this code into a text editor, replace the window width and height, the timeout and the image file name with your values and save as an .HTA file (e.g. showimage.hta).
HTAs can be run from command line by their name, e.g.
To run an HTA from VBScript, you can use the
WshShell.Runmethod: