albertminrich
Goto Top

Fehler in wsf-Script - Das Objekt unterstützt diese Eigenschaft oder Methode nicht -

Hallo,

auf unseren Windows 2003 Teminalservern ist die Datei msrdp.ocx registriert.
Die ist zuständig für eine Remotedesktop-Webverbindung
http://www.microsoft.com/downloads/details.aspx?displaylang=de&Fami ...

Mit folgender wsf-Datei wurde eine Web-Remotedesktopverbindung gestartet:


<?xml version="1.0" encoding="ISO-8859-1" ?>
<package>
<job>
<object id="Sh" progid="WScript.Shell"/>
<object id="FSO" progid="Scripting.FileSystemObject"/>
<script language="VBScript">
<![CDATA[
'Option Explicit
Const ForWriting = 2
Dim SRCFILE, ie

' ===========================
' CUSTOMIZE PROPERTIES BELOW
' ===========================

host = "agaapps" ' Can be IP or DNS name
desktopwidth = 1024 ' width of desktop session
desktopheight = 768 ' height of desktop session
username = "username" ' name of the user logging on
'pass = "pass" ' password to use with username above
dom = "KHA"

' ===========================
' END CUSTOMIZATION
' ===========================


RdpCall host, desktopwidth, desktopheight, _
username, pass

Sub RdpCall(sHost, x, y, Username, Password)
' Automatically connects to and logs on to a TS
' or Remote Desktop
' CAUTION: LOW SECURITY
' sHost = host IP
' x = desired desktop width
' y = desired desktop height
' Username - account for TS autologon
' Password - password for the account above on the TS
Dim Tsc, f
Set ie = WScript.CreateObject("InternetExplorer.Application", "ie_")
SRCFILE = Sh.ExpandEnvironmentStrings("%TEMP%") & "\" & FSO.GetTempName & ".htm"
set f = FSO.OpenTextFile(SRCFILE, ForWriting, True)
ie.Navigate SRCFILE
Do While ie.ReadyState<>4: WScript.Sleep 25:Loop
With ie
.AddressBar = False :.StatusBar = False :.MenuBar = False:.ToolBar = 0
.Document.open :.Document.write GetResource("rdp")
.Document.close
Set Tsc = .document.msrdp
.Width = (.Width - .document.body.clientwidth) + x
.Height = (.height - .document.body.clientheight) + y
End With
Tsc.Width = x
Tsc.Height = y
Tsc.Server = sHost
Tsc.UserName = Username
Tsc.Domain = dom
With Tsc.AdvancedSettings2
.ClearTextPassword = Password
'.ConnectToServerConsole = True
'.SmartSizing = True
.RedirectPrinters = True
End With
ie.resizable = True
ie.Visible = True
ie.FullScreen = False
Tsc.ConnectingText = " Now connecting to " & sHost
Tsc.Connect
End Sub

Sub ie_onQuit
' Fires when application is exited
' First, delete the tempfile we created
FSO.DeleteFile SRCFILE, True
' We're done, so exit the script
WScript.Quit
End Sub

]]>
</script>
<resource id="rdp">
<![CDATA[
<html><title>Himed</title></head>
<body id=iebody topmargin=0 leftmargin=0
rightmargin=0 bottommargin=0 scroll="no">
<object id=msRDP
CLASSID="CLSID:9059f30f-4eb1-4bd2-9fdc-36f43a218f4a">
</object></body></html>
]]>
</resource>
</job>
</package>

Gestern hab ich bei einigen der Server Windows-Update durchgeführt. Sie sind jetzt auf den neuestem Stand, dafür kommt jetzt beim Starten der wsf-Datei diese Fehlermeldung:
Script: test.wsf
Zeile: 57
Zeichen: 3
Fehler: Das Objekt unterstützt diese Eigenschaft oder Methode nicht.: 'Tsc.Server'
Code: 800A01B6
Quelle: Laufzeitfehler in Microsoft VBScript


Wie bring ich denn das wieder zum Laufen?
Danke
Martin

Content-Key: 125168

Url: https://administrator.de/contentid/125168

Printed on: April 20, 2024 at 00:04 o'clock

Member: AlbertMinrich
AlbertMinrich Sep 23, 2009 at 10:06:30 (UTC)
Goto Top
Mittlerweile hab ich rausgefunden, dass der Hotfix KB958469 das Problem verursacht.