Übergeben von Argumenten geht nicht

  • VB.NET

Es gibt 2 Antworten in diesem Thema. Der letzte Beitrag () ist von singu.

    Übergeben von Argumenten geht nicht

    Hallo,
    ich habe folgendes Problem

    Ich will ein Programm schreiben, das an die cmd.exe beim Start Argumente übergibt:

    Zuerst hab ich es versucht mit shell versucht, als das nicht funktionierte hab ich hier mal ein bisschen
    gestöbert und es hieß shell sei veraltet.

    VB.NET-Quellcode

    1. shell("copy /b bild.png + test.zip bild2.png")


    Dann habe ich versucht mit process.start zu arbeiten

    VB.NET-Quellcode

    1. Process.Start("cmd", "copy /b bild.png + test.zip bild2.png")


    Ging auch nicht.

    Dann hab ich hier noch diesen Code gefunden der aber auch nicht funktioniert:

    VB.NET-Quellcode

    1. Dim ProzessStartCOPY As New ProcessStartInfo("cmd", "copy /b bild.png + test.zip bild2.png")
    2. MsgBox("1")
    3. ProzessStartCOPY.UseShellExecute = False
    4. MsgBox("2")
    5. ProzessStartCOPY.CreateNoWindow = True
    6. MsgBox("3")
    7. Dim prozessCOPY As New Process
    8. prozessCOPY.StartInfo = ProzessStartCOPY
    9. MsgBox("4")
    10. prozessCOPY.Start()
    11. MsgBox("5")


    Die MsgBoxen sollten mir klar machen wo's hängt, aber der Code lief einwandfrei, wie die anderen auch, ohne Fehlermeldung.

    Allerdings hat sich nichts getan, tatsächlich nichts -.-

    Kann mir jemand einen Rat geben

    MfG BeNe