第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何使用CMD從文件路徑獲取文件夾路徑

如何使用CMD從文件路徑獲取文件夾路徑

慕仙森 2019-12-07 15:17:18
我需要包含cmd文件的文件夾的路徑。使用%0,我可以獲得文件名。但是如何獲取文件夾名稱?c:\ temp \ test.cmd >> test.cmdPS我的當(dāng)前目錄!=腳本文件夾。
查看完整描述

3 回答

?
蕪湖不蕪

TA貢獻1796條經(jīng)驗 獲得超7個贊

對于文件夾名稱和驅(qū)動器,可以使用:


echo %~dp0

使用不同的修飾符,您可以獲得更多信息:


%~I         - expands %I removing any surrounding quotes (")

%~fI        - expands %I to a fully qualified path name

%~dI        - expands %I to a drive letter only

%~pI        - expands %I to a path only

%~nI        - expands %I to a file name only

%~xI        - expands %I to a file extension only

%~sI        - expanded path contains short names only

%~aI        - expands %I to file attributes of file

%~tI        - expands %I to date/time of file

%~zI        - expands %I to size of file


The modifiers can be combined to get compound results:

%~dpI       - expands %I to a drive letter and path only

%~nxI       - expands %I to a file name and extension only

%~fsI       - expands %I to a full path name with short names only

這是來自“ for /?”的復(fù)制粘貼。提示符上的命令。希望能幫助到你。


有關(guān)

十大DOS批處理提示(是,DOS批處理...)顯示batchparams.bat(作為要點鏈接到源代碼):


C:\Temp>batchparams.bat c:\windows\notepad.exe

%~1     =      c:\windows\notepad.exe

%~f1     =      c:\WINDOWS\NOTEPAD.EXE

%~d1     =      c:

%~p1     =      \WINDOWS\

%~n1     =      NOTEPAD

%~x1     =      .EXE

%~s1     =      c:\WINDOWS\NOTEPAD.EXE

%~a1     =      --a------

%~t1     =      08/25/2005 01:50 AM

%~z1     =      17920

%~$PATHATH:1     =

%~dp1     =      c:\WINDOWS\

%~nx1     =      NOTEPAD.EXE

%~dp$PATH:1     =      c:\WINDOWS\

%~ftza1     =      --a------ 08/25/2005 01:50 AM 17920 c:\WINDOWS\NOTEPAD.EXE


查看完整回答
反對 回復(fù) 2019-12-07
  • 3 回答
  • 0 關(guān)注
  • 984 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號