Script to run c:\windows\system32\ipconfig.exe and either save it to a txt file or paste it into a memo and reply to sender.

Posted on 2006-05-23
Last Modified: 2013-12-18

I have a Lotus Notes @formula that I believe needs to contain 3 parts, but possibly two. Here is what I have...

Step 1: Gather Information: @Command([Execute]; "C:\\WINDOWS\\SYSTEM32\\IPCONFIG.EXE"; "/ALL > C:\\IPINFORMATION.TXT")
Step 2: Place Information either into a memo as text or attach INFORMATION.TXT to memo
Step 3: Reply to sender.

I can get step 3, no problem. I can not get 1 to create the IPINFORMATION.TXT file with any combo of the commands, and needless to say I can not get anything to attach or input into a notes memo.

Anyone have any experience with this? It's for a helpdesk to send out as a stationery to people to gain required information and send back to the agent for noting reasons.

Thanks in advance.
Question by:Klainn
    LVL 46

    Expert Comment

    by:Sjef Bosman
    Three suggestions:
        Step 1: @Command([Execute]; "C:\\WINDOWS\\SYSTEM32\\IPCONFIG.EXE /ALL > C:\\IPINFORMATION.TXT")
        Step 0: Create a batch-file using script, that contains the command in step 1
        Step 1: execute the batch file
        Step 1: @Command([Execute]; "C:\\WINDOWS\CMD\CMD.EXE /C IPCONFIG.EXE /ALL > C:\\IPINFORMATION.TXT")
    LVL 24

    Expert Comment

    It can be easily done with java code...

    There will be no messy command popups too

    LVL 43

    Expert Comment

    by:Steve Knight
    @Command([Execute]; "cmd"; "/C IPCONFIG.EXE /ALL > C:\\IPINFORMATION.TXT")  works for me as the first paramater is the command (cmd.exe) and the second is it's paramaters including the redirection to a text file

    Not very 'nice' way of doing it though really but if it does what is required...

    LVL 43

    Accepted Solution

    And a really crude, nasty way of attaching to a new memo:

    @Command([Execute]; "cmd"; "/C IPCONFIG.EXE /ALL > C:\\IPINFORMATION.TXT");
    @Command([Compose]; @MailDbName; "Memo");

    @PostedCommand( [EditInsertFileAttachment] ; "C:\\IPINFORMATION.TXT" );
    @Command( [EditInsertText] ; "Steve Knight/RPL" );
    @Command( [EditInsertText] ; "IP Information for this user" );
    @Command([EditGotoField] ; "Body" );

    Author Comment

    I am going to accept the answer from dragon-it, though I am not going to be able to use it due to limitations placed on our edition of lotus notes (custom config). Thank you all for your answers.
    LVL 43

    Expert Comment

    by:Steve Knight
    Thanks.... a whole 50 points :-)
    LVL 46

    Expert Comment

    by:Sjef Bosman
    Would you have preferred a split then?


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
    For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now