473,396 Members | 2,034 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,396 software developers and data experts.

execute more exe files in vb

Want to run 5 exe files step by step using single push button in visual basic.......any one help????????????
Oct 24 '11 #1
10 1972
Guido Geurs
767 Expert 512MB
how do you want to define the intervals between the Exe's?
All but with a time between each other or if the previous stops=> start the following one?
Oct 24 '11 #2
sir,
No specific time gap.I need by step by step.Tat is after one exe run completely,another exe should start run.. This is for software installtion program.I have 5 software exes.Instead of running each by manual,I need to run using single button vb scrpits.i.e when i click tat button 5 exes should run one by one..
Oct 24 '11 #3
Guido Geurs
767 Expert 512MB
This will start Notepad.
After closing notepad it will start regedit.
after closing it set a msgbox.

Expand|Select|Wrap|Line Numbers
  1. Option Explicit
  2.  
  3. Private Function IsProcessRunning(ByVal processName As String) As Boolean
  4. Dim ObjP As Object
  5. Dim ObjP2 As Object
  6. Dim ObjW As Object
  7.    Set ObjW = GetObject("winmgmts://.")
  8.    Set ObjP = ObjW.execquery("Select * from win32_Process")
  9.    For Each ObjP2 In ObjP
  10.       If ObjP2.Name = processName Then
  11.          IsProcessRunning = True: Exit Function 'return true.
  12.       End If
  13.    Next
  14. End Function
  15.  
  16. Private Sub Command1_Click()
  17.    Shell "C:\WINDOWS\system32\notepad.exe", vbNormalFocus
  18.    Do Until IsProcessRunning("notepad.exe") = False
  19.    Loop
  20.    Shell "C:\WINDOWS\regedit.exe", vbNormalFocus
  21.    Do Until IsProcessRunning("regedit.exe") = False
  22.    Loop
  23.    MsgBox "done"
  24. End Sub
Oct 25 '11 #4
thanks..Guido for your valuable reply.. I will confirm u once i incorpated
Oct 27 '11 #5
Dear guido,


I checked the program .. its working fine for our application.I need small change in that.i dont want to install the exe if already installed.That is suppose am installing 5 exe using the scripts,if the 4th exe get faled to install due to some reasons(like hardware problem,power off),in that case if i again execute the scripts,i dont want to execute the first 3 exe which is properly installed.the program have to install 4 th automatically.in other terms i need to check the properly installed exe in the program.. Kindly help me to include this..
Oct 30 '11 #6
Guido Geurs
767 Expert 512MB
Just write in a text file (Log) which files are installed.
Read this file at startup and check during installation if the programs are present in the Log text.
Attached Files
File Type: zip execute more exe files in vb_v2.zip (2.1 KB, 54 views)
Oct 30 '11 #7
sir,

Explanation not clear..can u please explain briefly.i.e where i need to incorpate the scrpits that u send on zip file
Oct 31 '11 #8
Guido Geurs
767 Expert 512MB
Save each time a program has been installed in a Log (.txt) file with:
Expand|Select|Wrap|Line Numbers
  1. Dim FNumOut As Integer
  2.    FNumOut = FreeFile()
  3.    On Error GoTo Error_Log
  4.    Open App.Path & "\program.log" For Output As #FNumOut
  5.       If InStr...
  6. ...
  7.       Write #FNumOut, "notepad.exe"
  8.       If InStr...
  9. ...
  10.       Write #FNumOut, "regedit.exe"
  11.    Close #FNumOut
  12. ...
  13. Exit Sub
  14. Error_Log:
  15.    MsgBox "there is an error in writing Log file"
  16.    Close #FNumOut
  17.  
Load the Log file at startup with:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. Dim FNumIn As Integer
  3. Dim INPUT_TEXT As String
  4.    If Dir$(App.Path & "\program.log") <> "program.log" Then _
  5.       GoTo No_Log
  6.    FNumIn = FreeFile()
  7.    On Error GoTo Error_Log_File
  8.    Open App.Path & "\program.log" For Input As #FNumIn
  9.    Do While Not EOF(FNumIn)
  10.       Line Input #FNumIn, INPUT_TEXT
  11.       LOGPRGS = LOGPRGS & INPUT_TEXT
  12.    Loop
  13.    Close #FNumIn
  14. Exit Sub
  15. No_Log:
  16.    MsgBox ("There is no ...\program.log file ")
  17. Exit Sub
  18. Error_Log_File:
  19.    MsgBox ("There is an error in the ...\program.log file ")
  20. End Sub
Check if the program has been installed with:
Expand|Select|Wrap|Line Numbers
  1. ...
  2.       If InStr(LOGPRGS, "notepad.exe") = 0 Then
  3.          Shell "C:\WINDOWS....
  4. ....
Oct 31 '11 #9
Dear guido,


I need to run that vb project as a exe so that i run that on other pc that donot have vb...Can u help to convet that as exe
Nov 2 '11 #10
Guido Geurs
767 Expert 512MB
Select in Menu : File - Make Exe (see GIF attached)
Attached Images
File Type: gif Make EXE.gif (8.1 KB, 141 views)
Dec 5 '11 #11

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

Similar topics

4
by: Chris | last post by:
I posted this in the C# language group, then thought it might be more appropriate in this group. I would not cross-post except I want the answer so badly. I built small C# Web and Web Service...
7
by: Rajiv Gupta | last post by:
Hi, We are moving from asp to asp.net. In our existing model we execute the asp by including them in .html files. For example: In abc.html file we include following directive: <!--exec...
1
by: Vavane | last post by:
When we update some files of our ASP.NET application on our customers servers, the vbc.exe process compiles these files "on the fly" at the first call. Right. For one server (running Windows...
1
by: S.Hoa | last post by:
Hello I have simple application with an Access database using VB.NET. I do not know how to export them to create execute files to run to other computers. I looked in Tool and Help but can not find...
2
by: joe1977 | last post by:
Win2k3, PHP 5, Apache 2, Acrobat 7 when I go to my server, pull out cmd.exe and type as follows: "c:\Program Files\Adobe\Acrobat 7.0\\Reader\AcroRd32.exe" /t "c:\Program Files\Adobe\Acrobat...
6
by: ajaykataram | last post by:
Hi all i am getting error in the following code to upload files csv and txt files i have to insert the following values only into database if firstname,lastname and email id is null it should not...
6
by: uthalcyon | last post by:
My objective is a Python program which ultimately creates a PDF. Presently, my program takes in a .csv file and creates a .tex file. Using cygwin, I can take a .tex file and convert it to .pdf in...
1
by: Annonymous Coward | last post by:
I have written a set of sql files that make my entire database schema. I have divided the schema into seperate files mostly for "manageability" (for example, I can check error codes as I go along,...
16
by: Wayne | last post by:
I've read that one method of repairing a misbehaving database is to save all database objects as text and then rebuild them from the text files. I've used the following code posted by Lyle...
1
by: james schrag | last post by:
I will attempt to explain my plight once again. I want a particular set of ssi files to execute automatically upon access to my website. I thought that possibly i could make this happen through a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.