OpenEdge 10.2A - INPUT THROUGH set not working after Windows Update 1703 on Windows 10

We used the code below to get the computer name.

def new shared var cHost as char format "x(40)" no-undo. 
INPUT THROUGH hostname NO-ECHO. 
SET cHost. 
INPUT CLOSE.
DISPLAY chost.

      

After we updated our computers (Windows 10-1703), it doesn't work anymore. It seems that the SET CHOST - this is the part where it fails. I tried IMPORT UNFORMATTED cHost but it doesn't work.

PS: I can get the computer name using OS-GETENV ("COMPUTERNAME") , but I have to do it using the INPUT THROUGH statement .


Edit: It seems like this is not only a 10.2A issue, but more general. Also, it is related not only to hostname , but all console applications and ms-dos commands . Now I will try to replace the INPUT THROUGH statement with a different execution command if there is one, or try to communicate with existing console applications using a different method.

+3


source to share


3 answers


Since this seems to be a bug until someone finds a better solution, here's how I would change my codes:

DEF VAR cHost AS CHAR FORMAT "x(40)" NO-UNDO. 
OS-CREATE-DIR VALUE("c:\temp").
OS-COMMAND SILENT VALUE("hostname >c:\temp\hostname.txt").
INPUT FROM VALUE("c:\temp\hostname.txt").
IMPORT UNFORMATTED cHost.
INPUT CLOSE.
MESSAGE cHost.

      

This code can be used for other ms-dos commands and console applications .



DEF VAR cHost AS CHAR FORMAT "x(40)" NO-UNDO. 
OS-CREATE-DIR VALUE("c:\temp").
OS-COMMAND SILENT VALUE("ECHO %cd% >c:\temp\result.txt").
INPUT FROM VALUE("c:\temp\result.txt").
IMPORT UNFORMATTED cHost.
INPUT CLOSE.
MESSAGE cHost.

      

Thank you for your help.

0


source


The first thing I would like to do is check that the "hostname" command still works as expected from the command line.

Assuming this is what I would code your snippet something like this:

INPUT THROUGH VALUE( "hostname" ).
IMPORT UNFORMATTED cHost.
INPUT CLOSE.
DISPLAY cHOST format "x(60)".

      



What might seem like a more helpful error message than "it no longer works".

Since COMPUTERNAME meets your needs, but you have to use INPUT THROUGH for some very mysterious reason, you can also try:

INPUT THROUGH VALUE( "echo %COMPUTERNAME%" ).
IMPORT UNFORMATTED cHost.
INPUT CLOSE.
DISPLAY cHOST format "x(60)".

      

0


source


The problem seems to be not limited to Openedge version 10. I am running Windows 10 winver 1703 for development using Progress / Openedge 8.3 and I can no longer get it done.

    def var a as char format "x(70)".

    input through "echo %cd%" no-echo.
    import unformatted a.
    input close.

    message a. pause.

      

This is done on a Windows 2012 R2 server using progress / open 8.3.

Where no longer works, it just exits the program when it hits the import command.

0


source







All Articles