internet.com
You are in the: Small Business Computing Channelarrow
Small Business Technology
» ECommerce-Guide | Small Business Computing | Webopedia | WinPlanet |Refer-It

WinPlanet Software Downloads and Reviews for Small Businesses
Search
Power Search | Tips
-
Navigate WinPlanet
WinPlanet Home Page

Software
Download Index
In-Depth Reviews
Tips & Tutorials
Updates
News

Software Categories
Browsers
Chat / Conferencing
Desktop Utilities
Development
Internet Apps
Multimedia
OS Service Packs
Productivity Tools

Software Glossary

WinPlanet Newsletter

internet.commerce
Partners & Affiliates













Small Business Computing
Small Business Computing
Ecommerce Guide
Webopedia
WinPlanet

WinPlanet / Tips & Tutorials

Download of the day
Internet Explorer 8

Most Popular Software Downloads
Opera
Internet Explorer 7
QuickTime for Windows
Winamp
Mozilla Firefox 3
Ad-Aware 2008 Free
Adobe Flash Player
Paint Shop Pro
Adobe Shockwave Player
AVG Anti-Virus Free
7-Zip

Most Popular Software Articles
Windows Vista Tips & Tricks, Part 1
Windows Vista: Worthy of the Hype?
Windows Wireless Zero Configuration: Five Steps to Sanity


Software Reviews

Tips for Windows 2000 and Windows Me
Trim Input by Using a Batch File
D. E. Levine

TIP 2. Limit Names to Eight Characters

You can limit names to eight (8) capital characters when passing them to a batch file. How you do it depends on whether you're using Windows 2000 or Windows Me.

1. Window 2000

When using Windows 2000 you can use the SET command to extract a substring from an environment variable.

Use the comman SET result=%original:~0,8% to set the variable result to 8 characters of the value of the variable Original, starting at the 0th (first) character, but without capitalizing the result.

2. Windows Me

If you're using Windows Me you'll have to write the following batch file in order to use the CHOICE command to split the input into individual letters and then re-assemble a maximum of 8 of the letters.

@ECHO OFF

IF '%1'=='['GOTO Process

ECHO Original: "%1"

ECHO;;|CHOICE/C;%1 %0>$Q.BAT

$Q.BAT

:Process

TYPE $Q.BAT

DEL $Q.BAT

SET x=

SET result=

:Loop

SHIFT

IF '%x%'=='xxxxxxxx' GOTO End

IF '%1'==" GOTO End

IF '%1'==']?' GOTO End

Set x=%x%x

SET result=%result%%1

GOTO Loop

:End

SET x=

ECHO Modified: "%result%"

Next: Scheduling Programs to Run in Windows 2000 »

« Previous Page| Next Page »

Contents:
1. Upgrading to Windows 2000
2. Trim Input by Using a Batch File
3. Scheduling Programs to Run in Windows 2000






JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers