473,320 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

execute and close application in vb6

3
how to run / execute other application and close it automatically after 5 minutes in visual basic 6 ?
Mar 17 '13 #1
3 5731
Killer42
8,435 Expert 8TB
A quick search should find you the details on how to execute - it's a question which has been answered here a number of times.

As for the 5 minutes, I'd suggest you use something like the DateAdd function to add 5 minutes to the current time, then sit in a Do loop executing DoEvents until the time passes that value. Alternatively, you could set a Timer control to trigger your code. However, I think the maximum interval they can wait for is about a minute or something (possibly half a minute?) so you'd need to trigger a few times to reach 5 minutes.
Apr 4 '13 #2
woyzer
3
hi Killer42, thanks for answer.

I have successfull make a program to run a application and close it after 5 minutes and reopen it again after 3 seconds closed.

i used this codes to open a application :

Expand|Select|Wrap|Line Numbers
  1. app = Shell(Environ$("programFiles") + "\Internet Explorer\iexplore.exe", vbNormalFocus)
and i use this procedure to close / terminate the application :

Expand|Select|Wrap|Line Numbers
  1. Private Sub TerminateProcess(app_exe As String)
  2.     Dim Process As Object
  3.     For Each Process In GetObject("winmgmts:").ExecQuery("Select Name from Win32_Process Where Name = '" & app_exe & "'")
  4.         Process.Terminate
  5.     Next
  6. End Sub
Now i want to open firefox with a URL opened in a tab, i want to close that tab without closing firefox, anybody can help?
Apr 7 '13 #3
woyzer
3
i use 1 minute timer interval and use a public variable (dim mnt as byte) that sub with 1 every 1 minute, count it until reach 5, set as 0 again after reach 5 and close a application opened before
Apr 7 '13 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Elie Grouchko | last post by:
Hi In Page1.asp I am calling Server.Execute("Page2.asp"). Before calling Server.Execute(), I set an application variable to a value that it is important for me to know that it doesn't get...
2
by: Elie Grouchko | last post by:
Hi All I am using Application.lock to protect a reference to a COM+ object while calling Server.Execute() to another ASP page. I am doing this to pass the object's reference to the other page,...
3
by: carmen | last post by:
I need to launch application-2 from application-1 and close application-1. My code is CreateProcess ("app2",0,0,0,0,0,0,0,0,0); Application.Exit(); but application-1 is not terminate since I...
5
by: Nicola Farina | last post by:
Hi all, I've a window form application with 3 forms. I want to catch the security exception when users run this application from a network share, thus I've made this code (I've notice that...
2
by: Paul Cheetham | last post by:
Hi, I am trying to execute another application from my VB.Net app. Using the Windows API I would use a WinExec call, but I don't seem to be able to find an equivalent function in VB.Net Can...
6
by: robert.waters | last post by:
Hello, Do you need to close an adodb recordset returned from a connection.execute(SQL) action? ex) set rcd = con.execute("SELECT * FROM TABLENAME") I know that close()ing objects that you...
3
by: rdemyan via AccessMonster.com | last post by:
Sometimes users (including myself) accidentally click on the application close icon in the application menu bar when they meant to just click on the 'X' for the form. Of course the app closes and...
4
by: =?Utf-8?B?TEJU?= | last post by:
Good day, I would like to execute an external application from a web form created using ASP.Net. I'm using System.Diagnostics.Process. It works fine if it is notepad.exe but it is not able to...
8
by: Rodrigo Juarez | last post by:
Hi I'm using Visual Studio 2005 with visual basic, developing winforms applications I'm adding try catch blocks for error handling and I want to close the application when I got an error....
2
by: babakandme | last post by:
How can I Run( Execute ) another application( Calc.exe ) from another application in VC++? I mean, is there any API or Function to do it? Appreciate...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.