Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 249
  • Last Modified:

timers

I need to run  v:\setup.exe/q  and have a timer showing for 3 minutes--

Setup.exe is a virus update that we run, and it runs everytime a pc boots up on our network.

My problem is that I set it up in a batch file and the setup runs for 2 mins - the user can't use their computer durinfg that time--ram issues

So I need to have a progress meter running in a window so that th user is aware that the update is still running--

Is there an easy way to do this in vb?

I'd like to launch  v:\setup.exe/q if it exists   and have a 3 min progress meter showing

if it does not exist I would like the program to close.

Thank\s

patrick
0
patrickm3
Asked:
patrickm3
  • 4
  • 3
  • 2
  • +3
1 Solution
 
JonFish85Commented:
to see if it exists:

If Dir("v:\setup.exe") = "" Then
  'File doesn't exist
Else
  'Run it
End If

Ill work on the progressbar thing...
0
 
JonFish85Commented:
try this: (add a progressbar named "prg" to your form and a timer named "timer1". Set timer1's interval property to 1000).

'Code starts
Option Explicit

Private Sub Form_Load()
  prg.Max = (60 * 3)
End Sub

Private Sub Timer1_Timer()
  prg.Value = prg.Value + 1
End Sub
'Code ends
0
 
patrickm3Author Commented:
I never used vb6 before, I'll give it a shot--

thanks

any other suggestions or tips would be helpful
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
patrickm3Author Commented:
'Run it


that actually launches the specified executable??
0
 
JonFish85Commented:
no, to start the file use:

Shell "v:\setup.exe /q"

hope this helps!
0
 
patrickm3Author Commented:
so how would it be written?


If Dir("v:\setup.exe") = "" Then
                      'File doesn't exist
                     Else
                      Shell "v:\setup.exe /q"
                     End If
0
 
JonFish85Commented:
that seems OK to me!
0
 
gbarenCommented:
Patrick,

Do you realize you have two of these questions? I just posted a comment to the other one, I'll move it here, so you could delete the other question.

gbaren
0
 
gbarenCommented:
Patrick,

Try this:

Option Explicit

Dim SecondsElapsed As Long

Private Sub Form_Load()
   
   If Len(Dir("v:\setup.exe")) > 0 Then
       ProgressBar1.Scrolling = ccScrollingSmooth
       Shell "v:\setup.exe /q"
       Timer1.Interval = 1000
       Timer1.Enabled = True
   Else
       Unload Me
   End If
   
End Sub


Private Sub Timer1_Timer()
   
   Timer1.Enabled = False
   SecondsElapsed = SecondsElapsed + 1
   If SecondsElapsed > 180 Then
       Unload Me
   Else
       Text1 = SecondsElapsed
       ProgressBar1.Value = CInt(SecondsElapsed / 180 * 100)
   End If
   Timer1.Enabled = True
   
End Sub
0
 
DanRollinsCommented:
Hi patrickm3,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Split points between: JonFish85 and gbaren

patrickm3, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
Richie_SimonettiCommented:
hearing...
Dan, OK with the other one.
Cheers
0
 
Computer101Commented:
Points split

Computer101
E-E Moderator
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now