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?
 
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.
0
 
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!
0
 
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
0
 
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



0
 
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.