Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

VB6 und Wscript Probleme

Empfohlene Antworten

Veröffentlicht

Ich will über eine VB-Oberfläche mit WSH auf nen Linux-Server zugreifen.

Per Hand ist das auch alles kein Problem.

cmd.exe -> telnet test-server[enter] dann bin ich schon auf dem Server und kann mich einloggen (Username und dann PW eingeben). Und dort will ich dann das PW ändern.

passwd username -> altesPW -> neuesPW -> neuesPW nochmals eingeben und fertig.

Das möchte ich gern Automatisieren. Also in der VB-Oberfläche muß man nur username, altesPW und neuesPW eingeben und eine Button drücken.. fertig!

Das ist was ich gern haben will. :rolleyes:



Private Sub Command3_Click()



    Dim wshShell


    Set wshShell = CreateObject("Wscript.Shell")         


    wshShell.Run ("telnet test-server")



    Delay 1

    wshShell.SendKeys ("username{ENTER}")


    Delay 1

    wshShell.SendKeys "asdfghjk" & vbCr


    Delay 1

    wshShell.SendKeys "passwd username" & vbCr


    Delay 1

    wshShell.SendKeys "asdfghjk" & vbCr


    Delay 1

    wshShell.SendKeys "qwertzui" & vbCr


    Delay 1

    wshShell.SendKeys "qwertzui" & vbCr


    Delay 1

    wshShell.SendKeys "exit" & vbCr



End Sub

Das benutz ich grad und es geht auch.. Problem: bei einer langsamen Verbindung gehts nicht, weil dann die Wartezeiten von mir net passen und bei einer fehlerhaften Eingabe geht dann alles schief. Ich will dies mit wshShell.exec statt mit .run machen, weil man damit auch die auslesen kann was grad in der cmd.exe-box drin steht. Also mit "wshShellE.stdin.write" reinschreiben und mit "wshShellE.stdout.readline()" auslesen.

    Dim strText As String


    Dim wshShell

    Dim wshShellE


    Set wshShell = CreateObject("Wscript.Shell")


    Set wshShellE = wshShell.exec("cmd.exe")             


    wshShellE.stdin.write ("telnet test-server{ENTER}")


    Do Until wshShellE.stdout.AtEndofStream


            strText = wshShellE.stdout.readline()


    Loop


    If InStr(strText, "login:") < 1 Then


        MsgBox "Consolentext: " & strText, vbOKOnly


    End If


    wshShellE.stdin.write ("username{ENTER}")


undsoweiter...

aber es funzt nicht.. :confused:

Kann mir da jemand bitte helfen!?!?!? :WD

HILFE?!?! :confused:

hat davon keiner n bissele plan??

Ich arbeite mich schon durch das Handbuch für WSH.. aber es will net gehen...

Werde mich mal darin vertiefen.

Danke Dir! :D

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.