Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

timers

Posted on 2001-06-22
12
Medium Priority
?
248 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 400 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

704 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