SORU
17 ŞUBAT 2011, PERŞEMBE


%~Dp0 ve nasıl çalışır?ne demek

%~dp0 çok yararlı buluyorum ve toplu iş dosyaları daha taşınabilir yapmak için bir çok kullanırım.

Ama etiketin kendisi bana çok gizemli... ~ ne yapıyor? dp Sürücü ve yol anlamına mı geliyor? 0 %0 dosya adı içeren bir toplu iş dosyası yolu ifade eder?

Yoksa sadece tuhaf bir etiket mi?

Ayrıca eğer belgelenmiş bir özelliği, ya da bir şeye itiraz eğilimli olup olmadığını bilmek istiyorum.

CEVAP
17 ŞUBAT 2011, PERŞEMBE


Arama

for /?

komut satırı bu sözdizimi hakkında yardım verir.

Ayrıca, değişim İÇİN değişken başvuruları geliştirilmiştir. Şimdi aşağıdaki isteğe bağlı kullanabilirsiniz kullanımı:

%~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
%~$PATH:I   - searches the directories listed in the PATH
               environment variable and expands %I to the
               fully qualified name of the first one found.
               If the environment variable name is not
               defined or the file is not found by the
               search, then this modifier expands to the
               empty string

Değiştiriciler almak için kombine edilebilir bileşik tespit edildi

%~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
%~dp$PATH:I - searches the directories listed in the PATH
               environment variable for %I and expands to the
               drive letter and path of the first one found.
%~ftzaI     - expands %I to a DIR like output line

Yukarıdaki örneklerde %I ve PATH yapabilirsiniz diğer geçerli değerler ile değiştirilir. %~ Sözdizimi geçerli bir tarafından sonlandırıldı Değişken adı İÇİN. Toplama büyük harf ben %gibi değişken isimleri daha yapar ve karışıklığı önler okunabilir olmayan değiştiriciler, dava hassas.

"Yol adı", d sürücü harfi, p yol için, ve kombine edilebilir. tam f gibi kullanabileceğiniz farklı harf var %~ başlangıçta her biri için bu dizileri ve numara I gösterir çalışır parametresi %I (%0 tam adı toplu iş dosyası gibi farz).

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Facebook Developers

    Facebook Dev

    24 ŞUBAT 2009
  • MrSuicideSheep

    MrSuicideShe

    9 NİSAN 2010
  • Truc Minh

    Truc Minh

    23 Ocak 2011