Ausführen vom VBS-Script von DAC-Bausteinen steuern

Hallo,
ich habe folgendes Problem:
Ich möchte das Ausführen eines VBS-Skrips über andere DAC-Bausteine steuern lassen. Zum Beispiel soll beim Beenden der Messung soll ein Wert in eine Textdatei geschrieben werden. Im Gegensatz zum Script Treiber (in diesem dürfen aber nur Autosequenzen verwendet werden), besitzt der Script DAC Treiber keine Steuereingänge. Ich habe versucht den normalen Eingang in eine If-Schleife einzubinden, jedoch ohne Erfolg. Hat jemand eine Idee wie das geht?
Grüsse s.g.

Die SFD_Init wird nur am Anfangs des Schaltplan angerufen (Initialisierungsroutine) während SFD_ProcessChannels wird bei jedem Takt aufgeführt.
SFD_DeInit wird nur am Ende durchgeführt.
Alle andere Funktionen sind internen Funktionen, die von eine diese 3 Funktionen aufgerufen sind.
Kontrollieren Sie, wo Sie FileWrite gemacht haben. Es soll im ProcessChannels gelegt werden, wenn es jedes Mal ausgeführt werden soll.
Ken

Similar Messages

  • LabView stürzt beim Ausführen vom Blockelement "1D-Array teilen" ab

    Hello,
    I think I've found a bug in LabView 8.5 and I've created a VI to reproduce this bug.
    At the second pass of the for-loop, LabView will be terminated with a heavy internal error at the execution of the block element "1D-Array teilen" Error message:
    Schwerer interner Fehler : "MemoryManager.cpp", Zeile 406
    LabVIEW Version 8.5
    Alle ungespeicherten Änderungen gehen verloren. Für Hilfestellung bei der Lösung dieses Problems starten Sie LabVIEW neu, oder kontaktieren Sie National Instruments.
    This Problem isn't occured with LabView 8.2.
    Attachments:
    reproduzierbarer_bug.vi ‏12 KB

    This must be a problem in the combination of a feedback node and split array. If the feedback node is replaced by a shift register or the split array ist replaced by e.g. delete from array, this error doesn't occur.
    Conclusion: AVOID THE EVIL FEEDBACK NODE. But since it is possible in LV 8.5 to put the feedback node into nested structures (e.g. case- structure), it is not replaceable by a shift register in every case without worsening the readability.
    greets, Dave
    Message Edited by daveTW on 10-18-2007 03:58 PM
    Greets, Dave

  • Absturz beim Beenden von VBS-Script mit eingebundener OCX

    Hallo!
    Ich habe eine OCX programmiert, die ueber den Befehl "createobject" in
    ein VBS-Script in der Subroutine "SFD_Init" eingebunden ist. In der
    Subroutine "SFD_ProcessChannel" werden Daten von einem Laser
    uebergeben. Beim Beenden des DAC-Schaltplans stuerzt Diadem ab, sobald
    in der SFD_Init der Befehl "llt.initlaser" (Initilaisiert den Laser)
    steht.
    Gibt es irgendeine Loesung? Liegt das Problem an Diadem? Ich hatte
    schon mal ein aehnliche s Problem mit einer OCX; damals liess es sich
    ueber den Befehl "set XYZ = nothing" loesen.
    Im Anhang befindet sich die DAC-Datei und das zugehoerige VBS-Script.
    Danke schon mal.
    Attachments:
    vector1.zip ‏4 KB

    Oh Entschuldigung!
    Mir ist gerade klar geworden das Sie auf Deutsch geschrieben haben.  Oops!   Hier nochmal in der richtige Sprache:
    Ich habe selber CreateObject auf eigene Komponente ohne Probleme verwendet.  Es ist ein VBS Befehl.  VBS übernimmt auch die verantwortung für Referenzzählen.  Wenn das Objekt dem Scope verlässt, oder Sie sein Referenz auf "Nothing" setzen, ruft VBS Release an Ihrem Objekt auf.  Objekte verlassen den Scope am Ende von einem Funktion oder Script.  Wenn Ihre Löschcode instabil ist, dann Stürzt Ihre Objekt am Ende von einer Funktion ab.
    Ich habe nicht viel kenntnisse zur DAC Script-Programmierung, aber da Ihre Probleme mit CreateObject in VBS ist, ist es unwahrscheinlich das DIAdem was damit zu tun hat.  Trotzdem, könnten sie das gleiche Code ausserhalb DIAdem laufenlassen.  Wenn es immer noch abstürzt, dann sollten Sie Ihre COM Code überprüfen und debuggen.
    Myrle
    For tips and tricks on creating VBScript DataPlugins go to http://dataplugins.blogspot.com.

  • Acrobat 4 Reader von CD-ROM ausführen

    pdfzone.de veröffentlicht kostenloses Manual "Acrobat 4 Reader von CD-ROM ausführen"
    Anwender aus ganz unterschiedlichen Bereichen verwenden heute Adobes Dateiformat PDF. Das Programm Acrobat Reader zum Anzeigen von PDF-Dokumenten ist millionenfach verbreitet und im Einsatz. Produzenten von CD-ROM Publikationen setzten PDF-Dokumente seltener ein, obwohl sich das Dateiformat für die kostengünstige Produktion eignet.
    Der Brite Mark Anderson beschreibt in seinem Werk, wie Acrobat Readers 4 ohne vorherige Installation auf dem System des Kunden bequem von der CD-ROM gestartet werden kann. In der vorn der pdfzone.de in Auftrag gegebenen Übersetzung des Manuals »Ausführen von Reader 4 von CD« werden die notwendigen Schritte detailliert erläutert. Die Übersetzung konnten mit Unterstützung von Adobe Deutschland, Systematica in Heidelberg und Txtlab in Köln realisiert werden.
    Das PDF-Dokument ReaderCD.pdf erläutert im Detail:
    + Wie Acrobat 4 Reader ohne vorherige Installation von CD-ROM gestartet werden kann.
    + Wie Installationsdateien des Acrobat 4 Reader auf CD-ROM verteilt werden.
    + Wie Index-Dateien für die Volltextsuche auf der CD-ROM mit Acrobat Reader erzeugt und angelegt werden.
    + Wie eine AutoPlay-CD-ROM für Windows erstellt wird.
    + Wie CD-ROMs für den gemischten Einsatz unter Windows- und Macintosh-Betriebssytem angelegt werden.
    + Es enthält zusätzlich viele Verknüpfungen auf wichtige Informationsquellen zu den genannten Themen im WorldWideWeb.
    http://www.pdfzone.de/aktuell/index.php3?nid=172

    You can download the full offline Reader installer from 
    http://get.adobe.com/reader/enterprise/
    and copy it in a CD, pendrive, whatever.

  • CS4 Clean up Script lässt sich nicht ausführen

    Hallo,
    ich habe ein kleines Problem. Ich hatte bereits CS3 drauf und möchte jetzt das System mit Clean Up Script bereinigen.
    Das habe ich bereits runtergeladen, jedoch lässt sich dieses nicht ausführen.
    Es kommt immer folgende Meldung:
    "Die Anwendung konnte nicht gestartet werden, weil MSVCR71.dlll nicht gefunden wurde. Neuinstallation der Anwendung könnte das Problem beheben".
    Was kann das bedeuten?
    Wie kann ich das hinbekommen, dass das Programm installiert wird?
    Ich bin damit echt schon lange beschäftigt und wäre super dankbar wenn mir jemand helfen könnte.
    Vielen Dank schon mal für die Hilfe!
    Mueder

    Hi,
    wenn man nach "msvcr71.dll konnte nicht gefunden werden" googelt, kann man den typischen "moduldatei msvcr71.dll herunterladen und in das c:\windows\system32 - verzeichnis kopieren" - Lösungsvorschlag z.B. bei Dr. Windows finden
    Günter

  • Data exchange Mainscript (SCRIPT) with script block (DAC)

    Is there any way to exchange data beetwen a Mainscript (SCRIPT) with
    user-dialoges and script block (DAC) in this way that the script in
    scriptblock can access to this data?
    Background: I write a DAC-Application with some script-blocks for
    reading and writing data to/from real devices. During the development
    I'd like to simulate all device accesses because I don'd have the
    devices in my office. I write all scripts with a branch for simulation
    an real measurement on startup.
    How can I execute a swich (simulation / mesurement) without changing
    all my scripts all times? Can a script read a variable anyway (Variable
    from Mainscript, Diadem-Uservariable or "Hilfsvariable" like L1)? 
    Can I fill "DeviceParam1V" with content of a variable?
    I could use a input channel connected with a formula-block for it. (The
    formula-block can read a variable.) But this way is uncomfortable an
    don't work for input blocks.
    Martin Bohm
    [email protected]

    Because the DAC Script is executed in its own runtime environment you cannot use the DIAdem variables as in a normal VBS or a SUD.
    Still, there are ways to exchange information.
    First of all by an extra channel as Input (you named it)
    Secondly, there are several variables you can use. Have a look at the Script DAC block. There are two fields called Parameter1 and Parameter2. And each signal you configure has a parameter of its own.
    Prior to starting the scheme, you can use a script to change the value of those parameters:
    Call DACObjOpen("Script-in1")
      VBSSignalParam(1) = "abc"
    Call DACObjClose("Script-in1")
    Is changing the parameter of the first signal that is configured.
    Call DACObjOpen("Script-in1")
      VBSParameter1 = "1st device parameter"
      VBSParameter2 = "2nd device parameter"
    Call DACObjClose("Script-in1")
    is changing the global device parameters.
    On the side of the Script DAC driver VBS you cann use the paramP funtion to access the signal parameter that corresponds to the actual channel (as referenced by ChannelnumberP)
    ' SFD_ReadChannel
    ' Zweck               : Lesen eines Wertes für den Kanal "ChannelNumberP"
    ' ChannelNumberP      | Kanalnummer aus dem Block-Dialog
    ' ParamP              | Vom Anwender definierte Variable aus dem Block-Dialog
    ' DataP               | Variable zur Rückgabe des neuen Kanalwertes. Diese
    '                     | Variable sollte zumindest auf einen gültigen Wert
    '                     | initialisiert werden.
    ' ErrorP              | Variable zur Rückgabe einer Fehlermeldung. Wird diese
    '                     | Variable gesetzt, stoppt DIAdem die Messung
    Sub SFD_ReadChannel( ChannelNumberP, ParamP, DataP, ErrorP )
    End Sub
    To acces the device Parameters, use the init function:
    ' SFD_Init
    ' Zweck               : Diese Prozedur wird während des Messungsstarts aufgerufen
    ' DeviceParam1V       | Erster Parameter, der vom Anwender im DAC-Block
    '                     | eingegeben werden kann
    ' DeviceParam2V       | Zweiter Parameter, der vom Anwender im DAC-Block
    '                     | eingegeben werden kann
    ' ErrorP              | Variable zur Rückgabe einer Fehlermeldung. Wird diese
    '                     | Variable gesetzt, stoppt DIAdem die Messung
    Sub SFD_Init( DeviceParam1V, DeviceParam2V, ErrorP )
    End Sub
    Ingo Schumacher
    Systems Engineer Sound&VibrationNational Instruments Germany

  • Indesign lässt sich trotz gültiger Seriennummer nicht ausführen

    Ich arbeite seit fast 2 Jahren mit Indesign CS 5.5
    Heute wollte das Programm plötzlich erneut die Seriennummern haben.
    Diese wurden auch akzeptiert, allerdings wurde das Programm nicht gestartet.
    Also habe ich Indesign deinstalliert, Rechner neu gestartet, Programm neu installiert.
    Die Seriennummern wurden erneut akzeptiert. Nach der Eingabe der Adobe ID samt Kennwort beendet sich das Programm automatisch.
    Auch lässt sich das Programm nicht als Testversion ausführen.
    Ich habe es auf zwei unterschiedlichen Rechnern probiert. Beide Windows 8 Systeme. Beide auf dem letzten Updatestand. Auf beiden Rechnern lässt sich Indesign nicht ausführen.
    Bitte um Hilfe!

    Guten Abend Michaela,
    was ich nicht verstehen kann, ist dass Dich ein Chat-Mensch hierher verwiesen hat. Nach all' dem oben geschilderten müsste man doch Adobe davon überzeugen können, dass Deine Seriennummer stimmt. Zur Absicherung könntest Du eine Verifizierung durchführen:
    http://helpx.adobe.com/de/x-productkb/policy-pricing/activation-deactivation-products.html.
    Von dort zitiere ich: "Aktivierung: Hierdurch kann Adobe überprüfen, ob Ihre Software und Seriennummer echt sind."
    Wenn das nichts fruchten würde, gehe zum Absatz: "Besteht das Problem weiterhin? Klicken Sie auf die Schaltfläche „Jetzt chatten“ und sprechen Sie mit einem Support-Mitarbeiter."
    Dieser hier "hingesetzte" Chat-Partner - im Gegensatz zu Chat-Partnern anderer Themen - müsste doch speziell für Dein Problem geschult sein und endlich eine Lösung finden können.
    Also, noch einmal alles Gute, LG
    Hans-Günter

  • Hallo. Mein computer lädt itunes zwar runter aber er kann es nicht ausführen was soll ich tun?

    Hallo.
    ICh habe ein Problem.
    mein Pc lädt das setup von ittunes zwar runter aber ich kann des dann nicht ausführen des stoppt dann immer zwischendrin. was kann cih tun??

    Repair your Apple Software Update>
    Go to START/ALL PROGRAMS/Apple Software Update. If it offers you a newer version of Apple Software Update, do it but Deselect any other software offered at the same time. Once done, try another iTunes install

  • Is it possible to read the contents of an Excel cell in DIAdem and assign its value to a variable in a VBS script.

    Hi All,
    Initially I thought this little problem would be relatively straight forward but now I’m not so sure. I am familiar with the mechanism by which DIAdem communicates with Excel and how to change the contents of a cell via a VBS script. In my task the contents of the cell in the first row, first column of MyProblem.xls contains the text “DIAdem”. I would like to be able to read this value and assign it to the variable MyString. I originally thought of doing something simple like this:
    Dim MyString
    Dim Excel, ExcelSheet
    Set Excel = CreateObject(“Excel.Application”)
    Excel.Workbooks.Open(“C\MyProblem.xls”)
    Set ExcelSheet = Excel.Workbooks(“MyProblem.xls”).Sheets(“Sheet1”)
    MyString = ExcelSheet.Cells(1,1)
    At this point I would have hoped that MyString would have been set equal to “DIAdem” and I could have used MyString to change the name of a channel in the data portal if I desired using the following code:
    Data.Root.ChannelGroups(1).Channels(1).Name = MyString
    Doesn’t seem to work though. I’m guessing it is because MyString has not picked up the value of the contents of the cell? Can anybody propose a solution to my problem or indeed confirm whether what I am proposing to do is technically feasible.
    Thanks in advance for any responses.
    Matthew

    Hi Matthew,
    Just staring at your ActiveX code, it looks fine to me.  My first thought is that this should work as you outlined it, and I've done this sort of thing many times, so I know it can work.  My second thought though, is that what you probably really want is a DataPlugin and not a VBScript.  Then you could just drag&drop the Excel file into the Data Portal and load all the properties and channels you want from the Excel file.  If you have DIAdem 2010 or later you can use the SpreadSheet reader object in the DataPlugin to avoid the Excel ActiveX functions (and Excel's jealously with other applications trying to read a file it has open already).
    Feel free to send me a few sample Excel files and describe what you want to load from the various cells, and I'd be happy to help you get a DataPlugin written to load your data.  You can also email me at [email protected]
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Cannot Execute Any UNIX Scripts From DAC

    Hello,
    I have a BI system implementation on Oracle Solaris Servers. Both DAC as well as Informatica are on single server. My business requirement calls for a frequent Data load into BI and Cache purge. i checked the forum and found so many articles on how to automate Purging of Cache Post ETL. I am successful in creating a script to purge the cache and i already tested it by executing the script manually. But when i call this script from a DAC task it fails. In order to make sure that there is no problem with the Script i created a simple script which just says "Hello" and tried to invoke the script from DAC task but failed.
    All Task Batches
    External Program Batch
      EXTERNAL PROGRAM TASKTest:/PurgeCache/CachePurge.sh:(Source : FULL Target : FULL)
      2013-10-13 17:40:38.015 Acquiring Resources
      2013-10-13 17:40:38.015 Acquired Resources
      2013-10-13 17:40:38.015 EXTERNAL PROGRAM TASKTest:/PurgeCache/CachePurge.sh:(Source : FULL Target : FULL) has started.
      ANOMALY INFO::: Error while executing : EXTERNAL PROGRAM TASKTest:/PurgeCache/CachePurge.sh:(Source : FULL Target : FULL)
      MESSAGE:::com.siebel.analytics.etl.execution.exceptions.ExternalProcessException:
      EXCEPTION CLASS::: java.lang.RuntimeException
      com.siebel.analytics.etl.etltask.GenericTaskImpl.doExecuteWithRetries(GenericTaskImpl.java:536)
      com.siebel.analytics.etl.etltask.GenericTaskImpl.execute(GenericTaskImpl.java:372)
      com.siebel.analytics.etl.etltask.GenericTaskImpl.execute(GenericTaskImpl.java:253)
      com.siebel.analytics.etl.etltask.GenericTaskImpl.run(GenericTaskImpl.java:655)
      com.siebel.analytics.etl.taskmanager.XCallable.call(XCallable.java:63)
      java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      java.util.concurrent.FutureTask.run(Unknown Source)
      java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      java.util.concurrent.FutureTask.run(Unknown Source)
      java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      java.lang.Thread.run(Unknown Source)
      ::: CAUSE :::
      MESSAGE :::
      EXCEPTION CLASS::: com.siebel.analytics.etl.execution.exceptions.ExternalProcessException
      com.siebel.analytics.etl.etltask.ExternalProgramTask.doExecute(ExternalProgramTask.java:99)
      com.siebel.analytics.etl.etltask.GenericTaskImpl.doExecuteWithRetries(GenericTaskImpl.java:477)
      com.siebel.analytics.etl.etltask.GenericTaskImpl.execute(GenericTaskImpl.java:372)
      com.siebel.analytics.etl.etltask.GenericTaskImpl.execute(GenericTaskImpl.java:253)
      com.siebel.analytics.etl.etltask.GenericTaskImpl.run(GenericTaskImpl.java:655)
      com.siebel.analytics.etl.taskmanager.XCallable.call(XCallable.java:63)
      java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      java.util.concurrent.FutureTask.run(Unknown Source)
      java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      java.util.concurrent.FutureTask.run(Unknown Source)
      java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      java.lang.Thread.run(Unknown Source)
      (Number of retries : 1)
      /PurgeCache/CachePurge.sh
      2013-10-13 17:40:38.031 EXTERNAL PROGRAM TASKTest:/PurgeCache/CachePurge.sh:(Source : FULL Target : FULL) has finished execution with Failed status.
    (Failed)
    Any help would be greatly appreciated.
    thanks and regards,
    Sree

    See the thread below:
    Re: FDM - Script

  • Vbs script to manage aspect ratios in PowerPoint (16:9 vs. 4:3)

    Hello. Can someone help me with the following?
    I need a VBS script to make PowerPoint's default slide size to 16:9 from 4:3.
    Thank you for any help here.
    Jrene

    Hello. Can someone help me with the following?
    I need a VBS script to make PowerPoint's default slide size to 16:9 from 4:3.
    Try this Google query:
    PowerPoint aspect ratio vbscript

  • How to capture events from vbs script in java

    Hello all
    i have vbs script that executing some actions after its done running or after its fails the vbs script
    returns string , my question is how can i execute this script but also capture in java the returned string from the vbs script
    Thanks

    Hello
    nop im talking about java here is what i got untill now .. ( not working )
    for example say i have vbscript that do only that :
    myVbs.vbs :
    set WshShell = WScript.CreateObject("WScript.Shell")
    WScript.Echo "Hello World!" and i like to capture this "Hello World!" string in my java code how can it be done?
    this is my java code , but its does not working ..
    public class ExcVbs {
         public static void main(String args[]) throws InterruptedException{
              Process p = null;
              try {
                   p = Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler myVbs.vbs" );
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              p.waitFor();
              OutputStream pus = p.getOutputStream();
              System.out.println(pus.toString());
              System.out.println( "Code=" + p.exitValue() );
    }

  • Error in vbs script using HFMClient Object

    I would like to make a VBS script to logout all users from a HFM application but I get this error:
    "Hyperion.HFMErrorHandler.1: <?xml version="1.0"?>
    <EStr><Ref>{0B24FBEE-81B4-4649-A84B-D106DCF5BD85}</Ref><AppName/><User/><DBUpdat
    e>1</DBUpdate><ESec><Num>-2147023174</Num><Type>0</Type><DTime>7/3/2012 3:56:46
    PM</DTime><Svr>LVZH11-DB</Svr><File>CHFMCASSecurity.cpp</File><Line>89</Line><Ve
    r>11.1.2.1.000.3082</Ver></ESec><ESec><Num>-2147023174</Num><Type>0</Type><DTime>
    7/3/2012 3:56:46 PM</DTime><Svr>LVZH11-DB</Svr><File>CHsxServer.cpp</File><Line>
    3446</Line><Ver>11.1.2.1.000.3082</Ver></ESec><ESec><Num>-2147023174</Num><Type>
    0</Type><DTime>7/3/2012 3:56:46 PM</DTime><Svr>LVZH11-DB</Svr><File>CHsxClient.
    cpp</File><Line>4081</Line><Ver>11.1.2.1.000.3082</Ver></ESec></EStr>"
    the code I used is:
    Sub killUs
    Dim hfmCl
         Set hfmCl = CreateObject("Hyperion.HfmClient")
         hfmCl.KillUsers "Cluster Name", False, "Application Name", True, ""
    End Sub

    Why? This is not a javascript forum.
    In any case, run it in firefox which has decent Javascript error handling functionality, then do some Google searches on Javascript event handling to try and figure out what you're doing wrong. It might be something browser specific and I suggest you look into using something like JQuery for standardized and proven ways to do things like event handling logic in stead of rolling your own Javascript stuff.

  • VBS-Scripting: DATAFILEIMPORT (ASCII) only imports first 20 channels

    Hello,
    I've got some problems with the automated DataFileImport via VBS-Script. The command DATAFILEIMPORT works, but it only imports the first 20 channels that are present in the data-file. The remaining 30 channels are ignored. If I import the same data file with the menu-command 'open' in the File-Menu in DIAdem-Navigator all data is imported correctly. What is the problem here?
    I'm using DIAdem 9.01 Service Pack 1.
    This is the command I'm using:
    Call DATAFILEIMPORT("D:\Messdaten\August_04\12.08.2004\Ergebnisse\2004-08-12_16-00-00_19-00-00_10sec.txt","asciiFilter",False)
    Thanks in advance
    Stefan

    Hallo Stefan,
    Problem erkannt! Du hast die STP-Datei mit einer Datendatei erstallt, die 20 Kanäle hatte und versuchst diese STP-Datei auf eine Datendatei mit 46 Kanälen anzuwenden. Hier liegt das Problem, denn eine STP-Datei kann für mehrere Datendateien nur dann benutzt werden, wenn die Struktur dieser Dateien identisch ist dh. alle Dateien die gleiche Anzahl Kanäle haben. Das dass interaktiv funktioniert liegt an einer Defaultannahme, die für Kanäle getroffen wird - aber die muss natürlich nicht stimmen (interaktiv kann das ja noch korrigiert werden per Script aber nicht). Zu diesem Problem gibt es in DIAdem 9.0 keine andere Lösung als für jede unterschiedliche Datenstruktur einen STP-File zu erstellen. In DIAdem 9.1 haben wir mit den DataPlugins eine flexible Alternative geschaffen. Infos hierzu findest du auf www.ni.com/dataplugins.
    Gruß
    br>Walter

  • VBS Script to validate RDP Connection

    I am working on a VBS script to confirm if RDP Connection is working on remote servers. I know some server administrators check it via Telnet on default RDP port 3389. But, it is not completely reliable. I need to open an RDP Connection to a server, capture
    the result, if the connection is working or not, document the results on a text file and close the window just opened. My code follows below:
    Const ForReading = 1
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.OpenTextFile("servers.txt", ForReading)
    Set oFSO = CreateObject("Scripting.FilesyStemObject")
    Outputfile="RDP.txt"
    Set ofile = ofso.createTextFile(OutputFile, True)
    ofile.writeline "computer" &vbtab& "Status"
    Dim arrFileLines(), computer, pingable
    i = 0
    Do Until objFile.AtEndOfStream
    Redim Preserve arrFileLines(i)
    arrFileLines(i) = objFile.ReadLine
    i = i + 1
    Loop
    objFile.Close
    For Each computer in arrFileLines
    Select Case RDPTest(computer)
    Case "RDP is working"
    wscript.echo computer &""& " RDP is working"
    ofile.writeline computer &""& vbtab & " RDP is working"
    Case "RDP is NOT working"
    wscript.echo computer & " RDP is not working"
    ofile.writeline computer &""& vbtab & " RDP is NOT working"
    End Select
    'WScript.Echo strLine
    Next
    Private Function RDPTest(ByVal strComputer)
    Dim objShell, objExecObject, strText
    Set objShell = CreateObject("Wscript.Shell")
    Set wshShell = CreateObject("WScript.Shell")
    Set objExecObject = wshShell.Exec("%comspec% /c mstsc /v:" & strComputer) 'Calls RDP Connection to the target server as per servers.txt list
    ret = wshShell.AppActivate(strComputer & " - Remote Desktop") 'Check out if the RDP window is opened for the target server
    If ret = True Then
    RDPTest = "RDP is working" 'Confirms RDP is working
    wshShell.SendKeys "%{F4}" 'Close up the RDP window
    Else
    RDPTest = "RDP is NOT working" 'Confirms RDP is not working
    wshShell.SendKeys "%{F4}" 'Close up the RDP-error window
    End If
    Do While Not objExecObject.StdOut.AtEndOfStream
    strText = strText & objExecObject.StdOut.ReadLine()
    Loop
    End Function
    The part that calls a remote server and open RDP by the servername provided on the servers.txt list is working. The problem is with the part that confirms the RDP window opened and close it posting the results. I need help to fix it. As it is the code is not
    recognizing the RDP window just opened by the script, it is not closing the window and not reporting the connections as working. I tested it by opening RDP manually to a server, then ran the script, and the window I opened before running the script was recongnized
    by the script, but it was not closed.
    I thank in advance any help on this question.

    You cannot do it like that.
    To test RPP use PortQry and check the returned string.  Use PowerShell.
    foreach($computers in $computers){
        $results=PortQryV2 -n $computer -p tcp -e 3389
        # process results
    That is all it takes.
    http://www.microsoft.com/en-us/download/details.aspx?id=17148
    ¯\_(ツ)_/¯

Maybe you are looking for

  • Some songs not playing on iPod in iPhone

    I've had about 4 iPhones over the past few years and before that i had a second generation iPod nano. Over this period of time, I purchased a lot of music thru iTunes either on my computer or thru the one in iPhone. I then transferred music over from

  • How do I set the iPhone 4s to answer in 5 rings?

    How do I set the iPhone 4s to answer in 5 rings?

  • Message Mapping - Dump

    I got the following dump, when I executed the Message Mapping. Eventhough I have fixed the problem, I am not quite sure to read the dump, i.e by reading the dump I was not sure which FIELD has caused the Dump. could some one help me , how I can read

  • Apex 4 Tree node icon inconsistency ( 4.0.2.00.06 = 4.0.2.00.07)

    <font color="#2C5197"> <li>If I assign a value to the tree icon column in Apex 4 ( 4.0.2.00.06) , _it is rendered as the node(ins) element's classname_ ( unless it has the "/" character in it,then it becomes the inline background-image property , for

  • FCP 5.1 Specs

    Need to install FCS1 (FCP 5.1) on a G5/Dual 2.5. What version of the OS (I'm assuming I should stay with Tiger) and Quicktime should I be at? Thanks!