Results 1 to 4 of 4

Thread: Batch File/Language Help [Resloved]

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2004
    Posts
    60

    Resolved Batch File/Language Help [Resloved]

    Hi,
    I am doing batch programming now. Currently, I am doing a if/else clause. I want to ask 2 things. 1st, if i want to do multiple things in the else command, how do i put them together? Using "and"? for example:
    ELSE (
    net send 192.168.100.78 configuration 1.1 download failed
    and
    start mailto:[email protected]?subject=Error^&body=Download%%20Has%%20Failed.%%20Please%%20Try%%20To%%20Down load%%20The%%20Configurations%%20Again.
    )
    The 2nd thing is how do I create txt files using batch commands? Like I want to create a textfile name error.txt in the else clause when the if condition is not met.
    Any help is greatly appreciated, thank you.
    Last edited by iori85z; Sep 26th, 2004 at 08:56 PM.

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    Here is a start

    from a thread

    not my own...

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2004
    Posts
    60

    Arrow

    thanks, but b4 posting this thread I have spend a long time searching for information on this in google. This webpage I have come across it b4. It is useful in the sense tat it teaches me more syntax and basics but it couldn't help my coding much. But thanks anyway.

  4. #4
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    To do multiple actions, just put the next command on the next line. But be careful, using the IF branches will only work on post W2K machines. Otherwise you'll need to jump to a label, perform your commands and jump back again.

    Regarding outputting to a file, you can use the pipe character > to output. So, e.g. :

    Code:
    @echo off
    @echo This is a test > c:\somefile.txt
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width