command to open up exe in vb
command to open up exe in vb
well can someone tell me what the command to open up an exe is in vb? im making a personal program that can start all my programs for me
-
- Posts: 115
- Joined: Fri Jan 14, 2005 9:26 am
- Location: Why The Fuck Would I Tell You? Indiana...
- Contact:
Yeah, shell whatever. For example:
or
Code: Select all
Shell "notepad.exe"
Code: Select all
Shell "C:\program.exe"
How to Post Correctly
SWYgeW91IGNhbiByZWFkIHRoaXMgeW91IGhhdmUgd2F5IHRvIG11Y2ggdGltZSBvbiB5b3VyIGhhbmRz
SWYgeW91IGNhbiByZWFkIHRoaXMgeW91IGhhdmUgd2F5IHRvIG11Y2ggdGltZSBvbiB5b3VyIGhhbmRz
-
- Posts: 870
- Joined: Tue Nov 09, 2004 10:09 pm
- Location: At Home On My Computer
- Contact:
-
- Posts: 870
- Joined: Tue Nov 09, 2004 10:09 pm
- Location: At Home On My Computer
- Contact:
I would just make an ini file. Put this in a bas file:
Those functions are fairly self explainatory but if you need help using them I will be happy to assist.
Code: Select all
Option Explicit
#If Win16 Then
Declare Function WritePrivateProfileString Lib "Kernel" (ByVal AppName As String, ByVal KeyName As String, ByVal NewString As String, ByVal fileName As String) As Integer
Declare Function GetPrivateProfileString Lib "Kernel" Alias "GetPrivateProfilestring" (ByVal AppName As String, ByVal KeyName As Any, ByVal default As String, ByVal ReturnedString As String, ByVal MAXSIZE As Integer, ByVal fileName As String) As Integer
#Else
Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As Any, ByVal lpFileName As String) As Long
#End If
Function ReadINI(Section, KeyName, fileName As String) As String
Dim sRet As String
sRet = String(255, Chr(0))
ReadINI = Left(sRet, GetPrivateProfileString(Section, ByVal KeyName, "", sRet, Len(sRet), fileName))
End Function
Function WriteINI(sSection As String, sKeyName As String, sNewString As String, sFileName) As Integer
Dim r
r = WritePrivateProfileString(sSection, sKeyName, sNewString, sFileName)
End Function
How to Post Correctly
SWYgeW91IGNhbiByZWFkIHRoaXMgeW91IGhhdmUgd2F5IHRvIG11Y2ggdGltZSBvbiB5b3VyIGhhbmRz
SWYgeW91IGNhbiByZWFkIHRoaXMgeW91IGhhdmUgd2F5IHRvIG11Y2ggdGltZSBvbiB5b3VyIGhhbmRz
-
- Posts: 870
- Joined: Tue Nov 09, 2004 10:09 pm
- Location: At Home On My Computer
- Contact:
-
- Posts: 870
- Joined: Tue Nov 09, 2004 10:09 pm
- Location: At Home On My Computer
- Contact:
Are you sure you put it in a bas file? I don't think it will work otherwise. Anyways, if you do
This code is for VB6 so if there are any errors post them.
Code: Select all
ff = FreeFile
Open "c:\test.txt" For Output As ff
Print #ff, "The contents of the textfile"
Close ff
How to Post Correctly
SWYgeW91IGNhbiByZWFkIHRoaXMgeW91IGhhdmUgd2F5IHRvIG11Y2ggdGltZSBvbiB5b3VyIGhhbmRz
SWYgeW91IGNhbiByZWFkIHRoaXMgeW91IGhhdmUgd2F5IHRvIG11Y2ggdGltZSBvbiB5b3VyIGhhbmRz
-
- Posts: 870
- Joined: Tue Nov 09, 2004 10:09 pm
- Location: At Home On My Computer
- Contact:
It's like a file that just contains code that is refrenced from your program. Also refered to as a Module. People put functions and other stuff they need, but don't want to get in the way. In VB6, this is how you would add one:

Hopefully it's simular in VB20005. It will then create an empty file. Copy and paste the contents of the ini code and it should work.

Hopefully it's simular in VB20005. It will then create an empty file. Copy and paste the contents of the ini code and it should work.
Last edited by Jefff on Sun Feb 20, 2005 3:52 pm, edited 1 time in total.
How to Post Correctly
SWYgeW91IGNhbiByZWFkIHRoaXMgeW91IGhhdmUgd2F5IHRvIG11Y2ggdGltZSBvbiB5b3VyIGhhbmRz
SWYgeW91IGNhbiByZWFkIHRoaXMgeW91IGhhdmUgd2F5IHRvIG11Y2ggdGltZSBvbiB5b3VyIGhhbmRz
-
- Posts: 870
- Joined: Tue Nov 09, 2004 10:09 pm
- Location: At Home On My Computer
- Contact:
-
- Posts: 870
- Joined: Tue Nov 09, 2004 10:09 pm
- Location: At Home On My Computer
- Contact:
Use the functions when you want to save or load a setting. For example, lets say MapPath is the path for a map file and you want the program to remember that. Use this command:
That will make (unless there already is one) a file called config.ini wherever the program is run. Now, say you now want to load the saved MapPath. Use this command:
Code: Select all
WriteINI("config", "Path", MapPath, App.Path + "\config.ini")
Code: Select all
MapPath = ReadINI("config", "Path", App.Path + "\config.ini")
How to Post Correctly
SWYgeW91IGNhbiByZWFkIHRoaXMgeW91IGhhdmUgd2F5IHRvIG11Y2ggdGltZSBvbiB5b3VyIGhhbmRz
SWYgeW91IGNhbiByZWFkIHRoaXMgeW91IGhhdmUgd2F5IHRvIG11Y2ggdGltZSBvbiB5b3VyIGhhbmRz
-
- Posts: 870
- Joined: Tue Nov 09, 2004 10:09 pm
- Location: At Home On My Computer
- Contact:
-
- Posts: 732
- Joined: Wed Nov 26, 2003 11:59 pm
- Location: Raleigh, NC, USA
![]() |
I think you probably need to change your working directory to your Halo directory before you execute Halo.exe. I don't use VB, so I don't know how you would do that, but it should fix it.theguy2042000 wrote:it doent work if you run halo
halo says fatal error it says it cant fing your programs config.txt file
how do you fix that
-
- Posts: 870
- Joined: Tue Nov 09, 2004 10:09 pm
- Location: At Home On My Computer
- Contact:
-
- Posts: 773
- Joined: Tue May 04, 2004 7:14 am
- Location: Uranus
![]() |
-
- Posts: 870
- Joined: Tue Nov 09, 2004 10:09 pm
- Location: At Home On My Computer
- Contact:
-
- Posts: 773
- Joined: Tue May 04, 2004 7:14 am
- Location: Uranus
![]() |
Think what you want. I have coding for a program that works on halo and the start is
Code: Select all
Private Sub Form_Load()
graphscale = 75
hWndConsole = HaloMemory.FindWindow(vbNullString, "Halo Console (1)")
HaloMemory.GetWindowThreadProcessId hWndConsole, pID
cboplayers.ListIndex = 0
End Sub
Your image cannot exceed 400x200 or 50kb