Rocket Software Homepage
Forum Home Forum Home > AccuTerm Knowledge Base (read only) > Advanced Features
  New Posts New Posts RSS Feed - Return result of IPCONFIG
  FAQ FAQ  Forum Search   Register Register  Login Login

The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum.

Forum LockedReturn result of IPCONFIG

 Post Reply Post Reply
Author
Message
anonymous View Drop Down
Groupie
Groupie


Joined: January 15 2004
Location: United States
Status: Offline
Points: 46
Post Options Post Options   Thanks (0) Thanks(0)   Quote anonymous Quote  Post ReplyReply Direct Link To This Post Topic: Return result of IPCONFIG
    Posted: October 13 2009 at 3:26am
We would like to execute a IPCONFIG /ALL on a local PC and capture the output back through accuterm. Is there a way to execute this command and have it return the information?
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: October 13 2009 at 3:30am
Its a bit messy, but you can return the result of most "DOS like" commands by using redirection to a file, then uploading the resulting file. Here is a small example:
EQU ESC TO CHAR(27), STX TO CHAR(2), CR TO CHAR(13)

DIRECTORY='D:\TMP\'
FILENAME='IPCONFIG.TXT'
* DELETE CURRENT FILE IF ANY
SCRIPT = 'On Error Resume Next :Kill "':DIRECTORY:FILENAME:'"':CR
PRINT ESC:STX:'P':SCRIPT:CR:
* ISSUE IPCONFIG COMMAND (USE CMD.EXE /C TO ALLOW
REDIRECTION TO FILE)
PRINT ESC:STX:'>CMD.EXE /C IPCONFIG /ALL
>> ':DIRECTORY:FILENAME:CR:
* RETURN CONTENTS OF IPCONFIG.TXT FILE
CALL FTS('R,K,T', DIRECTORY, FILENAME, RESULT, STAT)
* CHECK STATUS
IF STAT = '' THEN
PRINT 'RESULT:'
FOR I = 1 TO DCOUNT(RESULT, @AM)
PRINT RESULT<I>
NEXT I
END ELSE
PRINT 'FAILURE: ':STAT
END

Note that there is no way to disable the DOS window that pops up momentarily while the command executes.

Thanks,

Pete
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.