欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Windows批處理中獲取文件屬性的一些方法

 更新時(shí)間:2014年11月24日 14:30:00   投稿:junjie  
這篇文章主要介紹了Windows批處理中獲取文件屬性的一些方法,本文講解的是使用一些特殊標(biāo)記來(lái)獲得文件的相關(guān)屬性,需要的朋友可以參考下

windows的batchfile可以有%0-%9參數(shù),其中%0默認(rèn)表示batchfile的全路徑,%1-%9為用戶的傳入?yún)?shù)。

以下特殊標(biāo)記可以用來(lái)獲得文件的屬性,如果對(duì)%0使用特殊標(biāo)記,表示獲得batachfile的相關(guān)屬性,如果%1-%9中某個(gè)%*是個(gè)文件的路徑,也可以使用如下特殊標(biāo)記來(lái)獲得%*表示文件的相關(guān)屬性。

例如:D:\testfolder\test.bat

復(fù)制代碼 代碼如下:

echo off
echo path name:
echo %1
echo fully qualified path name:
echo %~f1
echo dirive:
echo %~d1
echo path:
echo %~p1
echo name:
echo %~n1
echo extention:
echo %~x1
echo short name:
echo %~s1
echo attribute:
echo %~a1
echo time:
echo %~t1
echo size:
echo %~z1
echo directory:
echo %~dp1

調(diào)用時(shí)為D:\testfolder\test.bat "c:\test\new folder\mytable.txt",輸出如下:

復(fù)制代碼 代碼如下:

D:\>echo off
path name:
"c:\test\new folder\mytable.txt"
fully qualified path name:
c:\test\New Folder\mytable.txt
dirive:
c:
path:
\test\New Folder\
name:
mytable
extention:
.txt
short name:
c:\test\NEWFOL~1\mytable.txt
attribute:
--a------
time:
2010-09-27 15:01
size:
directory:
c:\test\New Folder\

相關(guān)文章

最新評(píng)論