Solved

timers

Posted on 2001-06-22
12
240 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
Comment Utility
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
Comment Utility
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
Comment Utility
I never used vb6 before, I'll give it a shot--

thanks

any other suggestions or tips would be helpful
0
 

Author Comment

by:patrickm3
Comment Utility
'Run it


that actually launches the specified executable??
0
 
LVL 6

Expert Comment

by:JonFish85
Comment Utility
no, to start the file use:

Shell "v:\setup.exe /q"

hope this helps!
0
 

Author Comment

by:patrickm3
Comment Utility
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 6

Expert Comment

by:JonFish85
Comment Utility
that seems OK to me!
0
 
LVL 5

Expert Comment

by:gbaren
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
hearing...
Dan, OK with the other one.
Cheers
0
 
LVL 1

Expert Comment

by:Computer101
Comment Utility
Points split

Computer101
E-E Moderator
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now