Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   WScript "Das Handle ist ungültig" (https://www.delphipraxis.net/85329-wscript-das-handle-ist-ungueltig.html)

Luckie 29. Jan 2007 13:10


WScript "Das Handle ist ungültig"
 
Ich habe folgendes WScript:
Code:
Wscript.StdOut.Write "Enter a Decimal Number: "
strDecimal = Wscript.StdIn.ReadLine

Wscript.StdOut.WriteLine strDecimal & " is equal to " & _
Hex(strDecimal) & " in hex."
Will ich dies ausführen, bekomme ich in Zeile eins die Fehlermeldung, dass das Handle ungültig sei? Woran kann das liegen?

shmia 29. Jan 2007 13:24

Re: WScript "Das Handle ist ungültig"
 
Wird dein Script über WScript.exe oder CScript.exe abgearbeitet?
Nur bei CScript.exe steht ein Konsolenfenster für Ein- und Ausgabe zur Verfügung.
Zitat:

The StdOut property returns an object representing the standard output stream. The StdIn, StdOut, and StdErr streams can be accessed while using CScript.exe only. Attempting to access these streams while using WScript.exe produces an error.
Schau dir mal die Option /H von CScript.exe an.

Luckie 29. Jan 2007 13:28

Re: WScript "Das Handle ist ungültig"
 
Oh, das wusste ich nicht. Es wird wahrscheinlich standardmäßig über WScript.exe ausgeführt. Mit CScript geht es. Danke.


Alle Zeitangaben in WEZ +1. Es ist jetzt 22:58 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz