Solved

timers

Posted on 2001-06-22
12
244 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
  • 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…

821 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