Shell mit Parameter!

Folgendes Problem:

Ich will eine .exe Datei mit der Shell Funktion aufmachen, allerdings möchte ich auch noch einen Paramter String übergeben!

Ich hoffe jmd kann mir helfen!

Mfg

Patrick

PS: Das zu öffnende Programm ist ein Konsolen Anwendung (mysqldump)

Hallo,

Beispiel mit Notepad:

Option Explicit

Private Sub Command1\_Click()
 Shell "Notepad.exe c:\Test.txt", vbNormalFocus
End Sub

Gruß, Rainer

Hallo,

Wenn ich jetzt aber z.B.: als Parameter „-u root“ übergeben will wie mache ich das!

mfg

Patrick

[Bei dieser Antwort wurde das Vollzitat nachträglich automatisiert entfernt]

Hallo,

Wenn ich jetzt aber z.B.: als Parameter „-u root“ übergeben
will wie mache ich das!

mit MySql kenne ich mich nicht aus. Wie sieht das denn in der Konsole aus? Der String muß genau so aussehen. (… fehlt da nicht das Passwort?)

Gruß, Rainer

Hallo,

Denk gar nicht an MySQL ist ganz egal!
Das einzige was ich nur wissen will ist:

Wie starte ich ein Programm mit einem beliebigen Paramter!

z.B.:

„C:\colinux\colinux-daemon.exe“ -t nt -c config.xml

Dieses Programm jetzt mit den Parametern per Code starten!

mfg

Patrick

Hallo,

Denk gar nicht an MySQL ist ganz egal!

dann habe ich ja Glück gehabt.

Das einzige was ich nur wissen will ist:

Wie starte ich ein Programm mit einem beliebigen Paramter!

z.B.:

„C:\colinux\colinux-daemon.exe“ -t nt -c config.xml

Du hast nur die Anführungszeichen an der falschen Stelle.

Shell „C:\colinux\colinux-daemon.exe -t nt -c config.xml“, vbNormalFocus

Gruß, Rainer
PS. … wenn Du das Handle nicht brauchst. Sonst:

hWnd = Shell („C:\colinux\colinux-daemon.exe -t nt -c config.xml“, vbNormalFocus)

Denk gar nicht an MySQL ist ganz egal!
Das einzige was ich nur wissen will ist:
Wie starte ich ein Programm mit einem beliebigen Paramter!
z.B.:
„C:\colinux\colinux-daemon.exe“ -t nt -c config.xml

Hi Patrick,
hast du den Ansatz von rainer nicht ausprobiert?
Private Sub Command1_Click()
Shell „C:\colinux\colinux-daemon.exe -t nt -c config.xml“ ,vbNormalFocus
End Sub

Gruß
reinhard

Danke!
Hallo,

Vielen Dank für die Hilfe!

mfg

Patrick

Shell „C:\colinux\colinux-daemon.exe -t nt -c config.xml“,

noch eine kleine Anmerkung, wenn du Parameter mit Pfaden übergibst kann das manchmal problematisch sein, mit dem Shell Befehl. Dann sollte auch der Pfad in Anführungszeichen stehen. Viele machen daß dann irgendwie mit „“"" Anführungszeichen. Perönlich übersichtlicher finde ich diese Methode:

Shell "C:\colinux\colinux-deamon.exe -p " & chr(34) & „Irgend ein Pfad“ & chr(34)

Grüße