+ Post New Thread
Results 1 to 7 of 7
Windows 7 Thread, Batch Files in Technical; It has been years since I last needed to use a batch file. But I am trying to created a ...
  1. #1

    Join Date
    Feb 2013
    Location
    YORK
    Posts
    10
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Batch Files

    It has been years since I last needed to use a batch file.
    But I am trying to created a bootable Dos iso image to mount in ilo for flashing Boot from iscsi Intel i350 T2 cards
    I can now type all the commands in my boot from dos

    so next I thought I would make it easier with a menu in a batch file that calls the 4 batch files I wrote to process the commands

    my problem is when I run the file below I have to press enter 2 time so for example I select option 2 press enter nothing happens till I press enter again .

    I have tried several things as you can see from the syntax below none of them work

    Any ideas??
    ECHO OFF
    CLS
    :MENU
    ECHO.
    ECHO ...............................................
    ECHO PRESS 1, 2 ,3 or 4 to select your task, or 5 to EXIT.
    ECHO ...............................................
    ECHO.
    ECHO 1 - Flash Enable Nic 1
    ECHO 2 - Flash Enable Nic 2
    ECHO 3 - Enable boot from Iscsi Nic 1
    ECHO 4 - Enable boot from Iscsi Nic 2
    ECHO 5 - Exit
    ECHO.
    set /p input="Select number: "
    SET /P M=Type 1, 2, 3, or 4 then press ENTER:
    IF %input%==1 GOTO flnic1
    IF %input%==2 GOTO flnic2
    IF %input%==3 GOTO enbnic1
    IF %input%==4 GOTO enbnic2
    IF %input%==5 GOTO exit


    :flnic1 @echo off
    flnic1.bat
    pause
    GOTO MENU

    :flnic2
    start "" flnic2.bat
    GOTO MENU

    :enbnic1
    CALL enbnic1.bat
    GOTO MENU

    :enbnic2
    start /wait cmd /k CALL enbnic2.bat
    GOTO MENU

    :exit
    exit

  2. #2


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    9,069
    Thank Post
    232
    Thanked 2,719 Times in 2,007 Posts
    Rep Power
    797
    Try this...

    Code:
    @ECHO OFF
    CLS
    :MENU
    ECHO.
    ECHO ...............................................
    ECHO PRESS 1, 2, 3 or 4 to select your task, or 5 to EXIT.
    ECHO ...............................................
    ECHO.
    ECHO 1 - Flash Enable NIC 1
    ECHO 2 - Flash Enable NIC 2
    ECHO 3 - Enable boot from iSCSI NIC 1
    ECHO 4 - Enable boot from iSCSI NIC 2
    ECHO 5 - Exit
    ECHO.
    SET /P M=Type 1, 2, 3, or 4 then press ENTER:
    IF %input%==1 GOTO flnic1
    IF %input%==2 GOTO flnic2
    IF %input%==3 GOTO enbnic1
    IF %input%==4 GOTO enbnic2
    IF %input%==5 GOTO EOF
    
    :flnic1
    CALL flnic1.bat
    pause
    GOTO MENU
    
    :flnic2
    CALL flnic2.bat
    GOTO MENU
    
    :enbnic1
    CALL enbnic1.bat
    GOTO MENU
    
    :enbnic2
    CALL enbnic2.bat
    GOTO MENU
    Last edited by Arthur; 13th May 2014 at 05:13 PM.

  3. #3

    Join Date
    Feb 2013
    Location
    YORK
    Posts
    10
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    no same result after you select say 2
    you get the line press 1,2,4 or4 to select your ask or 5 to Exit
    press enter again and it runs the second batch file

    thanks

  4. #4


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    9,069
    Thank Post
    232
    Thanked 2,719 Times in 2,007 Posts
    Rep Power
    797
    Could you try the batch file above again? I've made a few changes.

  5. #5

    nephilim's Avatar
    Join Date
    Nov 2008
    Location
    Dunstable
    Posts
    12,081
    Thank Post
    1,637
    Thanked 1,957 Times in 1,431 Posts
    Blog Entries
    2
    Rep Power
    440
    Arthur it works for me.

    Windows 7 Enterprise x64 test base

  6. Thanks to nephilim from:

    Arthur (13th May 2014)

  7. #6

    Join Date
    Feb 2013
    Location
    YORK
    Posts
    10
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    ok that is better but I need to see the batch file it connects to stay open in a cmd window as it shows the results of the cmd

  8. #7


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    9,069
    Thank Post
    232
    Thanked 2,719 Times in 2,007 Posts
    Rep Power
    797
    This should do what you need...

    Code:
    @ECHO OFF
    CLS
    :MENU
    ECHO.
    ECHO ------------------------------------------------------
    ECHO  PRESS 1, 2, 3 or 4 to select your task, or 5 to EXIT
    ECHO ------------------------------------------------------
    ECHO  1 - Flash Enable NIC 1
    ECHO  2 - Flash Enable NIC 2
    ECHO  3 - Enable boot from iSCSI NIC 1
    ECHO  4 - Enable boot from iSCSI NIC 2
    ECHO  5 - Exit
    ECHO.
    SET /P INPUT=Type 1, 2, 3, or 4 then press ENTER:
    IF %INPUT%==1 GOTO flnic1
    IF %INPUT%==2 GOTO flnic2
    IF %INPUT%==3 GOTO enbnic1
    IF %INPUT%==4 GOTO enbnic2
    IF %INPUT%==5 GOTO EOF
    GOTO MENU
    
    :flnic1
    CALL flnic1.bat
    GOTO MENU
    
    :flnic2
    CALL flnic2.bat
    GOTO MENU
    
    :enbnic1
    CALL enbnic1.bat
    GOTO MENU
    
    :enbnic2
    CALL enbnic2.bat
    GOTO MENU

SHARE:
+ Post New Thread

Similar Threads

  1. batch file to shutdown PCs
    By macca in forum Windows
    Replies: 5
    Last Post: 3rd May 2007, 09:20 AM
  2. prezzie batch file to collect dps logs
    By russdev in forum ICT KS3 SATS Tests
    Replies: 4
    Last Post: 16th May 2006, 12:16 PM
  3. batch file help
    By beeswax in forum Scripts
    Replies: 9
    Last Post: 3rd March 2006, 07:48 PM
  4. numbers and batch files
    By russdev in forum Windows
    Replies: 4
    Last Post: 19th November 2005, 09:51 PM
  5. Blocking Batch Files using Group Policy in Server 2003
    By markwilliamson2001 in forum Windows
    Replies: 13
    Last Post: 4th October 2005, 05:28 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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