SORU
9 Temmuz 2010, Cuma


Toplu: dosya uzantısı Kaldır

Wikipedia'dan aşağıdaki toplu iş komut dosyası var:

@echo off
    for /R "C:\Users\Admin\Ordner" %%f in (*.flv) do (
    echo %%f
)
pause

-Döngü uzantılı bütün dosyaları flv yankılandı, ama ben bu dosya ile bazı eylemler(ler)istiyorum bir keresinde yere uzatılması ve uzatma ile bir kez olmadan dosya. Nasıl bu ikisini alabilir miyim?

Çözüm aradım ama bulamadım. Parti içinde gerçek bir acemi değilim...

CEVAP
9 Temmuz 2010, Cuma


%%~nf for için başvuru açıklandığı gibi dosya adını almak için kullanabilirsiniz:

@echo off
    for /R "C:\Users\Admin\Ordner" %%f in (*.flv) do (
    echo %%~nf
)
pause

Aşağıdaki seçenekler kullanılabilir:

Variable with modifier  Description

%~I                     Expands %I which removes any surrounding 
                        quotation marks ("").
%~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                    Expands path to contain short names only.
%~aI                    Expands %I to the file attributes of file.
%~tI                    Expands %I to the date and time of file.
%~zI                    Expands %I to the 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,
                        this modifier expands to the empty string.    

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

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Friday Night Cranks

    Friday Night

    27 Mayıs 2007
  • Kindness

    Kindness

    23 Ocak 2006
  • USI Events

    USI Events

    6 AĞUSTOS 2013