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.

[vbscript] Textdatei einlesen und ausführen

Empfohlene Antworten

Hallo :)

da wir hier bei Textdateien sind hätte ich auch folgende frage:

ich würde gerne ein vb script schreiben, dass eine Textdatei einliest und dessen Inhalt (cmd Befehle) Zeile für Zeile ausführt.

kann mir dabei jemand helfen?

:)

mfg

Danke für die schnelle Antwort:)

hab das ganze mal getestet

Code:

Imports System.IO

Module Module1

Sub Main()

Const ForReading = 1, ForWriting = 2, ForAppending = 8

Dim fso, MyFile, FileName, TextLine

fso = CreateObject("Scripting.FileSystemObject")

' Open the file for output.

FileName = ("C:\test.txt")

MyFile = fso.OpenTextFile(FileName, ForWriting, True)

' Write to the file.

' MyFile.WriteLine("Hello world!")

' MyFile.WriteLine("The quick brown fox")

MyFile.Close()

' Open the file for input.

MyFile = fso.OpenTextFile(FileName, ForReading)

' Read from the file and display the results.

Do While MyFile.AtEndOfStream <> True

TextLine = MyFile.ReadLine

Document.Write(TextLine & "<br />")

Loop

MyFile.Close()

End Sub

End Module

jetzt bringt er mir VB immer noch die Fehlermeldung

"Document" wurde nicht deklariert. Auf das Objekt kann aufgrund seiner

Schutzstufe möglicherweise nicht zugegriffen werden.

Sorry bin absoluter Neuling in VB :(

Was muss ich tun?

welche Code Zeile ist jetzt nun genau für das Ausführen

der Textdateizeilen verantwortlich?

Die Zeilen "write to the file..."

kann ich ja weg lassen...ich will ja nichts in die Textdatei reinschreiben.

Vielen Dank für die Hilfe!

:)

MFG

Bearbeitet von Fisi20102010

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.