home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Phoenix CD 2.0
/
Phoenix_CD.cdr
/
01e
/
let12.zip
/
DEMO-9.BAT
< prev
next >
Wrap
DOS Batch File
|
1987-09-17
|
1KB
|
34 lines
echo Off
If `%Name%' == `' Demo
cls
echo ╔════════════════════════════════════════════════════════════════╗
echo ┌─╫────────────────────────────────────────────────────────────────╫─┐
echo │ ║ File Specification Parsing: FILESPEC ║ │
echo └─╫────────────────────────────────────────────────────────────────╫─┘
echo ╚════════════════════════════════════════════════════════════════╝
echo
echo Now we turn to a neat little feature that LET has to offer: file-name
echo parsing. Given a file-name, we can `explode' it into its constituent
echo parts: the drive, the (absolute) path, the file's name, and its
echo extension. For example, I am going to ask for a file specification
echo below. You can give me any portion(s) you want: you can omit the
echo path, for example, or give me a relative or absolute path. You can
echo omit the drive, or specify it. Whatever.
echo
LET dummy=(do "filespec")
echo I get the following parts:
echo Drive: %fileDrive%
echo Path: %filePath% (this is from the root)
echo Name: %fileName%
echo Ext: %fileExt%
echo Put all together, you would have "%file2%".
echo
set file=
set fileDrive=
set filePath=
set fileName=
set fileExt=
set file2=
pause
DEMO-10