Seungweon's Blog

in Portland, Oregon

In order to make nice help screen at batch file, use of blank line is inevitable. I tried to do it with "echo" command in dos prompt of Windows XP but echo command looks it does not support this.

Displays messages, or turns command-echoing on or off.

ECHO [ON | OFF]
ECHO [message]

Type ECHO without parameters to display the current echo setting.


When I just use "echo" in batch file, it justs show the current echo mode is On or Off.
However, you can use "echo," which mean "echo" followed by "," will work properly. I'm not sure it will work with other operating systems, but I confirmed that it works at Vista and XP. Note: You can use ":", ".",";","=","+","[","]","/","\","/" instead of "," as well.

Below is the example of batch file which shows blank line in help memu.

@Echo Off
echo -------------------------------------------------------------------------
echo Remove VLANs from the Team with VLAN numbers.
echo Written by Seungweon Park(seungweonxxxxx@intel.com)
echo,
echo In order to run this batch file, you need to have this script located at
echo at C:\Program Files\Intel\NCS2\Scripts on the computer where you
echo installed DMiX:
echo,
echo -------------------------------------------------------------------------
set vlan_id=%1
if (%2)==() (GoTo :Usage) Else (GoTo :Run)
:Usage
echo Usage:
echo %0 VLAN_ID VLAN_NUMBERS
echo ex) %0 1 "21,22"
echo create VLAN 21 and VLAN 22 on the Team ID 1
goto :EOF
:Run
for /f %%a in (%2) do call :PARSE %%a
Goto :EOF
:PARSE
if "%1"=="" GOTO :EOF
echo %1
cscript VLAN_CreateVLANOnTeam.vbs %vlan_id% %1
Shift
GoTo :PARSE

1 comments:

Seungweon Park said...

In XP,
1. Do Administrative Tools->Local Security Settings->Local Policies->Security Options and
look for the line "Network Access:Sharing and security model for local accounts".
2. Change "key" to "Classic - local users authenticate as themselves".

Post a Comment