Solved

timers

Posted on 2001-06-22
12
246 Views
Last Modified: 2010-05-02
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
Comment
Question by:patrickm3
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +3
12 Comments
 
LVL 6

Expert Comment

by:JonFish85
ID: 6219747
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
 
LVL 6

Accepted Solution

by:
JonFish85 earned 100 total points
ID: 6219764
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
 

Author Comment

by:patrickm3
ID: 6219783
I never used vb6 before, I'll give it a shot--

thanks

any other suggestions or tips would be helpful
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 

Author Comment

by:patrickm3
ID: 6219797
'Run it


that actually launches the specified executable??
0
 
LVL 6

Expert Comment

by:JonFish85
ID: 6219805
no, to start the file use:

Shell "v:\setup.exe /q"

hope this helps!
0
 

Author Comment

by:patrickm3
ID: 6219849
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
 
LVL 6

Expert Comment

by:JonFish85
ID: 6220340
that seems OK to me!
0
 
LVL 5

Expert Comment

by:gbaren
ID: 6220789
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
 
LVL 5

Expert Comment

by:gbaren
ID: 6220790
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
 
LVL 49

Expert Comment

by:DanRollins
ID: 7139706
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
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7143182
hearing...
Dan, OK with the other one.
Cheers
0
 
LVL 1

Expert Comment

by:Computer101
ID: 7178655
Points split

Computer101
E-E Moderator
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month7 days, 9 hours left to enroll

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question