How to Show Pictures with Vbscript?

Hi All,

Not sure if this is the right place but it was the closest I got to vbscript...

I need something very simple... I am writing a logonscript  in vbscript to run in my windows environment and would like to have a .gif picture on the screen while the script runs...

I was, however, not able to find any way to show a picture (file) on the screen with vbscript...

Any hint?

Thanks!
rosadoAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dds110Commented:
despite its name, there is nothing visual about vbscript (other than input boxes and msg boxes).  your best bet would to create a simple exe to display the image and load that while your script runs.  If you don't have access to vb, you could always do it in java.

Let me know if you need help.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rosadoAuthor Commented:
dds110,

Thanks a lot for your reply, actually thats what was working on. I am using a visual basic component called angif which works pretty fine. I did a vb project which just opens the gif and compiled to prodruce an exe file. I call that file with a wshshell.run  and it works quite fine.

The only problem is that the form stays on the screen after the script finishes... any idea of how can I close an exe from a vbscript?

Thansk again!
dds110Commented:
I'm not sure if wshshell can handle it or not, but if you use automation directly from vbscript, you can most likely use the .Quit method on your application.

HTH
vinnyd79Commented:
Not sure if this is something you want to try,but as a workaround you could create a textfile in your vbscript before calling the exe. Then have the exe unload itself when it detects that the script has deleted the file.

For example,in your exe add a timer to your form and add the following:

Private Sub Form_Load()
Timer1.Interval = 1000
End Sub

Private Sub Timer1_Timer()
If Dir("C:\Flagfile.vin") = "" Then  
   ' file is gone, so shutdown
    Timer1.Enabled = False
    Unload Me
End If
End Sub


Then in your script:


Dim wShell,fso,fil

Set fso = CreateObject("Scripting.FileSystemObject")
' create textfile
Set fil = fso.CreateTextFile("C:\Flagfile.vin")

set wShell = CreateObject("Wscript.Shell")
wShell.Run "C:\Project1.exe",1

' do stuff here

set fil = nothing

' delete text file. When exe detects textfile is gone it will shutdown
fso.DeleteFile "C:\Flagfile.vin"

set fso = Nothing
Set wShell = Nothing



dds110Commented:
vinnyd79's got a great idea.  Wish I could be more helpful but I don't have VB at work where I can run my own tests.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.