Verknüpfung suchen

execute
Hi,

ich bin neu im der VB Welt und möchte ein Programm erstellen dass beim starten von Windows mitstartet. Es soll so konzipiert sein, dass man mit verschiedenen Buttons verschiedene Programme aufrufen kann (Wenn möglich auch noch schliessen). Die Buttons hab ich schon, ich kann auch schon Programme öffnen, aber nur, wenn die im gleichen Verzeichnis sind. Ich möchte, dass die Buttons mit den Programmen zwar schon vorgeschrieben sind, aber dass ich mit so nem "Durchsuchen" Button jeweils das Programm auswählen kann. Es soll dann für immer so verlinkt sein (evtl. änderungen sollen auch möglich sein). Kann mir da einer helfen? (Bin mir nicht sicher, aber ich glaube, dass das viel arbeit ist, oder?)
fireflyer
naja ich würde mal so sagen 1 woche arbeit wenn man jeden tag bischen was dran macht!?
am besten erstellst du eine datei im ordner des programmes die datei sollte eine txt oder inf oder so sein. in dieser datei schirebst du die pfade rein von den einzelnen exe'sen dass programm machste in autostart von windows und wenn es startet dann liest es die txt und sucht sich die pfade raus, sobald man dann auf den jeweiligen button klickt geht es zu dem bestimmten pfad und öffnet die exe

P.S.: post mal bitte die funktion wie man programme öffnen kann Augenzwinkern
execute
Befehl: Shell "Dateipfad"
execute
So in der art, nur ben umgebaut und zusätzliche funktionen:
http://www.activevb-archiv.de/downloadst...b6/tipp0128.zip
fireflyer
also ich habe das einfach mal gemacht, ich denke das du das teil nur für dich willst oder? also hier sind meine codes (ist visualbasic.net)

Codefile:

code:
1:
2:
3:
4:
5:
6:
7:
8:
Class test
    Shared Sub main()
        Dim F1 As Form1 = New Form1
        F1.ShowDialog()
    End Sub
End Class


Form1:

code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
Imports Microsoft.VisualBasic
Public Class Form1
    Inherits System.Windows.Forms.Form
    Dim ofile As IO.StreamReader
    Dim Zeile As String
    Dim Zeile1 As String
    Dim Zeile2 As String
    Dim Zeile3 As String

#Region " Vom Windows Form Designer generierter Code "

    Public Sub New()
        MyBase.New()

        ' Dieser Aufruf ist für den Windows Form-Designer erforderlich.
        InitializeComponent()

        ' Initialisierungen nach dem Aufruf InitializeComponent() hinzufügen

    End Sub

    ' Die Form überschreibt den Löschvorgang der Basisklasse, um Komponenten zu bereinigen.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    ' Für Windows Form-Designer erforderlich
    Private components As System.ComponentModel.IContainer

    'HINWEIS: Die folgende Prozedur ist für den Windows Form-Designer erforderlich
    'Sie kann mit dem Windows Form-Designer modifiziert werden.
    'Verwenden Sie nicht den Code-Editor zur Bearbeitung.
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents Button2 As System.Windows.Forms.Button
    Friend WithEvents Button3 As System.Windows.Forms.Button
    Friend WithEvents Button4 As System.Windows.Forms.Button
    Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
    Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
    Friend WithEvents OpenFileDialog1 As System.Windows.Forms.OpenFileDialog
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.Button1 = New System.Windows.Forms.Button
        Me.Button2 = New System.Windows.Forms.Button
        Me.Button3 = New System.Windows.Forms.Button
        Me.Button4 = New System.Windows.Forms.Button
        Me.TextBox1 = New System.Windows.Forms.TextBox
        Me.GroupBox1 = New System.Windows.Forms.GroupBox
        Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog
        Me.GroupBox1.SuspendLayout()
        Me.SuspendLayout()
        '
        'Button1
        '
        Me.Button1.Location = New System.Drawing.Point(8, 24)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(96, 24)
        Me.Button1.TabIndex = 1
        Me.Button1.Text = "ViceBuilder 1.3"
        '
        'Button2
        '
        Me.Button2.Location = New System.Drawing.Point(120, 24)
        Me.Button2.Name = "Button2"
        Me.Button2.Size = New System.Drawing.Size(96, 24)
        Me.Button2.TabIndex = 2
        Me.Button2.Text = "Icq"
        '
        'Button3
        '
        Me.Button3.Location = New System.Drawing.Point(232, 24)
        Me.Button3.Name = "Button3"
        Me.Button3.Size = New System.Drawing.Size(96, 24)
        Me.Button3.TabIndex = 3
        Me.Button3.Text = "Cinema 4d"
        '
        'Button4
        '
        Me.Button4.Location = New System.Drawing.Point(344, 24)
        Me.Button4.Name = "Button4"
        Me.Button4.Size = New System.Drawing.Size(96, 24)
        Me.Button4.TabIndex = 4
        Me.Button4.Text = "MSN"
        '
        'TextBox1
        '
        Me.TextBox1.BackColor = System.Drawing.SystemColors.InactiveBorder
        Me.TextBox1.Enabled = False
        Me.TextBox1.Location = New System.Drawing.Point(8, 72)
        Me.TextBox1.Name = "TextBox1"
        Me.TextBox1.Size = New System.Drawing.Size(448, 20)
        Me.TextBox1.TabIndex = 5
        Me.TextBox1.Text = "Pfad"
        '
        'GroupBox1
        '
        Me.GroupBox1.Controls.Add(Me.Button3)
        Me.GroupBox1.Controls.Add(Me.Button4)
        Me.GroupBox1.Controls.Add(Me.Button2)
        Me.GroupBox1.Controls.Add(Me.Button1)
        Me.GroupBox1.Location = New System.Drawing.Point(8, 8)
        Me.GroupBox1.Name = "GroupBox1"
        Me.GroupBox1.Size = New System.Drawing.Size(448, 56)
        Me.GroupBox1.TabIndex = 6
        Me.GroupBox1.TabStop = False
        Me.GroupBox1.Text = "Bitte wählen sie ein Programm aus"
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.BackColor = System.Drawing.SystemColors.ActiveBorder
        Me.ClientSize = New System.Drawing.Size(464, 102)
        Me.Controls.Add(Me.GroupBox1)
        Me.Controls.Add(Me.TextBox1)
        Me.Name = "Form1"
        Me.Text = "Programm starter"
        Me.GroupBox1.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ofile = New IO.StreamReader("C:\Ps\pfade.txt")
        Zeile = ofile.ReadLine
        Zeile1 = ofile.ReadLine
        Zeile2 = ofile.ReadLine
        Zeile3 = ofile.ReadLine
        Shell(Zeile)
        Me.TextBox1.Text = Zeile
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        ofile = New IO.StreamReader("C:\Ps\pfade.txt")
        Zeile = ofile.ReadLine
        Zeile1 = ofile.ReadLine
        Zeile2 = ofile.ReadLine
        Zeile3 = ofile.ReadLine
        Shell(Zeile1)
        Me.TextBox1.Text = Zeile1
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        ofile = New IO.StreamReader("C:\Ps\pfade.txt")
        Zeile = ofile.ReadLine
        Zeile1 = ofile.ReadLine
        Zeile2 = ofile.ReadLine
        Zeile3 = ofile.ReadLine
        Shell(Zeile2)
        Me.TextBox1.Text = Zeile2
    End Sub
    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        ofile = New IO.StreamReader("C:\Ps\pfade.txt")
        Zeile = ofile.ReadLine
        Zeile1 = ofile.ReadLine
        Zeile2 = ofile.ReadLine
        Zeile3 = ofile.ReadLine
        Shell(Zeile3)
        MsgBox(Zeile3)
        Me.TextBox1.Text = Zeile3
    End Sub
End Class


Die pfad.txt enthält diese "werte":

code:
1:
2:
3:
4:
5:
6:
"C:\-=]My Tools[=-\Builder 1.3\ViceBuilder13.exe"
"C:\Programme\ICQ\Icq.exe"
"C:\Programme\Maxon Cinema 4D 8.0\CINEMA_4D.exe"
"C:\Programme\Messenger\msmsgs.exe"



Es ist nicht die beste art aber es funktioniert Augenzwinkern , vielleicht muss man es bischen bei visual basic umschireben, kp
Ich hoffe ich konnte dir helfen Augenzwinkern
execute
Super, dass du dir soviel mühe gegeben hast, aber ich bekomm nur fehlermeldungen, jede dritte Zeile ist rot. Wäre echt SUPER, wenn mir jemand das komplette in einer .vbp Datei per E-Mail zuschicken könnte, wäre echt sau geil.
Meine E-Mail: michael.weishaar@gmx.de
fireflyer
das problem ist wahrscheinlich das du visual basic benutzt aber ich visual basic .NET unglücklich kann vielleicht jemand anderst noch helfen?
execute
Hat denn niemand ne antwort? heulen
fireflyer
also ich habe mein programm jetzt optiemiert, ist noch net ganz fertig aber ... was klappt den nu bei dir nicht?
execute
Bin ja NewBie.
Ich hab ehlichgesagt keine Ahnung an was der fehler liegt, muss ich irgendwas besonderes beachten?
fireflyer
fehlet mir nix ein :/