Windows: October 2011 Archives

Windows CMD substr

user-pic
Vote 0 Votes

這個技巧是用在 Windows CMD 批次檔中切字串使用, 純 DOS 環境不適用

C:\>echo %windir%
C:\Windows

從第一個字的位置(0)開始取2碼
C:\>echo %windir:~0,2%
C:

從第3位置開始取4碼
C:\>echo %windir:~3,4%
Wind

從第3位置開始取到結尾
C:\>echo %windir:~3%
Windows

Recent Entries

About this Archive

This page is an archive of entries in the Windows category from October 2011.

Windows: September 2011 is the previous archive.

Windows: November 2011 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Monthly Archives