• 17-01-2015, 23:56:26
    #1
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Merhaba arkadaşlar,

    .bat dosyası şeklinde bulunduğu klasörde dosyaları rasgele tekrar isimlendiren bir program buldum fakat şu şekilde isim veriyor. dosyaismi.html >> 1091-5111-18206_dosyaismi.html

    Ben bu sayıları öne değil de arkaya gitmesini istiyorum. dosyaismi_1091-5111-18206.html diye. Belki aslında çok basit ama komutlardan anlamadığım için yapamadım. Birkaç defa denedim ama bu sefer bozuldu. Yardımcı olursanız çok sevinirim.

    @ECHO OFF
    ECHO Random Names
    ECHO Written By: Jason Faulkner
    ECHO HowToGeek.com
    ECHO.
    ECHO.
    
    REM Randomly renames every file in a directory.
    
    SETLOCAL EnableExtensions EnableDelayedExpansion
    
    REM 0 = Rename the file randomly.
    REM 1 = Prepend the existing file name with randomly generated string.
    SET PrependOnly=1
    
    REM 1 = Undo changes according to the translation file.
    REM This will only work if the file "__Translation.txt" is in the same folder.
    REM If you delete the translaction file, you will not be able to undo the changes!
    SET Undo=0
    
    
    REM --------------------------------------------------------------------------
    REM Do not modify anything below this line unless you know what you are doing.
    REM --------------------------------------------------------------------------
    
    SET TranslationFile=__Translation.txt
    
    IF NOT {%Undo%}=={1} (
        REM Rename files
        ECHO You are about to randomly rename every file in the following folder:
        ECHO %~dp0
        ECHO.
        ECHO A file named %TranslationFile% will be created which allows you to undo this.
        ECHO Warning: If %TranslationFile% is lost/deleted, this action cannot be undone.
        ECHO Type "OK" to continue.
        SET /P Confirm=
        IF /I NOT {!Confirm!}=={OK} (
            ECHO.
            ECHO Aborting.
            GOTO :EOF
        )
    
        ECHO Original Name/Random Name > %TranslationFile%
        ECHO ------------------------- >> %TranslationFile%
    
        FOR /F "tokens=*" %%A IN ('DIR /A:-D /B') DO (
            IF NOT %%A==%~nx0 (
                IF NOT %%A==%TranslationFile% (
                    SET Use=%%~xA
                    IF {%PrependOnly%}=={1} SET Use=_%%A
                    
                    SET NewName=!RANDOM!-!RANDOM!-!RANDOM!!Use!
                    ECHO %%A/!NewName!>> %TranslationFile%
                    
                    RENAME "%%A" "!NewName!"
                )
            )
        )
    ) ELSE (
        ECHO Undo mode.
        IF NOT EXIST %TranslationFile% (
            ECHO Missing translation file: %TranslationFile%
            PAUSE
            GOTO :EOF
        )
        FOR /F "skip=2 tokens=1,2 delims=/" %%A IN (%TranslationFile%) DO RENAME "%%B" "%%A"
        DEL /F /Q %TranslationFile%
    )
  • 18-01-2015, 00:01:16
    #2
    Üyeliği durduruldu
    rslinks adlı üyeden alıntı: mesajı görüntüle
    Merhaba arkadaşlar,

    .bat dosyası şeklinde bulunduğu klasörde dosyaları rasgele tekrar isimlendiren bir program buldum fakat şu şekilde isim veriyor. dosyaismi.html >> 1091-5111-18206_dosyaismi.html

    Ben bu sayıları öne değil de arkaya gitmesini istiyorum. dosyaismi_1091-5111-18206.html diye. Belki aslında çok basit ama komutlardan anlamadığım için yapamadım. Birkaç defa denedim ama bu sefer bozuldu. Yardımcı olursanız çok sevinirim.

    @ECHO OFF
    ECHO Random Names
    ECHO Written By: Jason Faulkner
    ECHO HowToGeek.com
    ECHO.
    ECHO.
    
    REM Randomly renames every file in a directory.
    
    SETLOCAL EnableExtensions EnableDelayedExpansion
    
    REM 0 = Rename the file randomly.
    REM 1 = Prepend the existing file name with randomly generated string.
    SET PrependOnly=0
    
    REM 1 = Undo changes according to the translation file.
    REM This will only work if the file "__Translation.txt" is in the same folder.
    REM If you delete the translaction file, you will not be able to undo the changes!
    SET Undo=0
    
    
    REM --------------------------------------------------------------------------
    REM Do not modify anything below this line unless you know what you are doing.
    REM --------------------------------------------------------------------------
    
    SET TranslationFile=__Translation.txt
    
    IF NOT {%Undo%}=={1} (
        REM Rename files
        ECHO You are about to randomly rename every file in the following folder:
        ECHO %~dp0
        ECHO.
        ECHO A file named %TranslationFile% will be created which allows you to undo this.
        ECHO Warning: If %TranslationFile% is lost/deleted, this action cannot be undone.
        ECHO Type "OK" to continue.
        SET /P Confirm=
        IF /I NOT {!Confirm!}=={OK} (
            ECHO.
            ECHO Aborting.
            GOTO :EOF
        )
    
        ECHO Original Name/Random Name > %TranslationFile%
        ECHO ------------------------- >> %TranslationFile%
    
        FOR /F "tokens=*" %%A IN ('DIR /A:-D /B') DO (
            IF NOT %%A==%~nx0 (
                IF NOT %%A==%TranslationFile% (
                    SET Use=%%~xA
                    IF {%PrependOnly%}=={1} SET Use=_%%A
                    
                    SET NewName=!RANDOM!-!RANDOM!-!RANDOM!!Use!
                    ECHO %%A/!NewName!>> %TranslationFile%
                    
                    RENAME "%%A" "!NewName!"
                )
            )
        )
    ) ELSE (
        ECHO Undo mode.
        IF NOT EXIST %TranslationFile% (
            ECHO Missing translation file: %TranslationFile%
            PAUSE
            GOTO :EOF
        )
        FOR /F "skip=2 tokens=1,2 delims=/" %%A IN (%TranslationFile%) DO RENAME "%%B" "%%A"
        DEL /F /Q %TranslationFile%
    )
    SET NewName=!RANDOM!-!RANDOM!-!RANDOM!!Use!
    yazan yeri

    SET NewName=!!Use!-!RANDOM!-!RANDOM!-!RANDOM
    ile değiştirin
  • 18-01-2015, 00:02:18
    #3
    Bende dosyaların adlarını değiştirdi fakat orjinal adlarını yazmadı yeni ismine
    29657-25863-24815.asp şeklinde değiştirdi conn_in.asp dosyasının adını
  • 18-01-2015, 00:05:12
    #4
    djcenk adlı üyeden alıntı: mesajı görüntüle
    Bende dosyaların adlarını değiştirdi fakat orjinal adlarını yazmadı yeni ismine
    29657-25863-24815.asp şeklinde değiştirdi conn_in.asp dosyasının adını
    Hocam şimdi değiştirdim SET PrependOnly=1 olması gerekiyor.

    --R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 00:05:12 -->-> Daha önceki mesaj 00:03:57 --

    spider58 adlı üyeden alıntı: mesajı görüntüle
    SET NewName=!RANDOM!-!RANDOM!-!RANDOM!!Use!
    yazan yeri

    SET NewName=!!Use!-!RANDOM!-!RANDOM!-!RANDOM
    ile değiştirin
    Dediğinizi yaptım ama bu seferde dosya uzantıları gitti. dosyaismi.html-14836-5218-8822 bu şekilde hocam.
  • 18-01-2015, 19:38:25
    #5
    Arkadaşlar ufak bir kod ekledim. Benim isimlendirceğim dosyaların uzantısının hepsi jpg formatında o yüzden şöyle oluyor. Chrysanthemum.jpg-14691-17153-3610.jpg Bu benim işimi görür. Daha geliştirebilirseniz iyi olur bilen biri varsa o ilk jpg formatını silemedim.

    REM Randomly renames every file in a directory.
    
    SETLOCAL EnableExtensions EnableDelayedExpansion
    
    REM 0 = Rename the file randomly.
    REM 1 = Prepend the existing file name with randomly generated string.
    SET PrependOnly=1
    
    REM 1 = Undo changes according to the translation file.
    REM This will only work if the file "__Translation.txt" is in the same folder.
    REM If you delete the translaction file, you will not be able to undo the changes!
    SET Undo=0
    
    SET TranslationFile=__Translation.txt
    
    IF NOT {%Undo%}=={1} (
        REM Rename files
        ECHO You are about to randomly rename every file in the following folder:
        ECHO %~dp0
        ECHO.
        ECHO A file named %TranslationFile% will be created which allows you to undo this.
        ECHO Warning: If %TranslationFile% is lost/deleted, this action cannot be undone.
        ECHO Type "OK" to continue.
        SET /P Confirm=
        IF /I NOT {!Confirm!}=={OK} (
            ECHO.
            ECHO Aborting.
            GOTO :EOF
        )
    
        ECHO Original Name/Random Name > %TranslationFile%
        ECHO ------------------------- >> %TranslationFile%
    
        FOR /F "tokens=*" %%A IN ('DIR /A:-D /B') DO (
            IF NOT %%A==%~nx0 (
                IF NOT %%A==%TranslationFile% (
                    SET Use=%%~xA
                    SET Use2=.jpg
                    IF {%PrependOnly%}=={1} SET Use=%%A-
                    
                    SET NewName=!Use!!RANDOM!-!RANDOM!-!RANDOM!!Use2!
                    ECHO %%A/!NewName!>> %TranslationFile%
                    
                    RENAME "%%A" "!NewName!"
                )
            )
        )
    ) ELSE (
        ECHO Undo mode.
        IF NOT EXIST %TranslationFile% (
            ECHO Missing translation file: %TranslationFile%
            PAUSE
            GOTO :EOF
        )
        FOR /F "skip=2 tokens=1,2 delims=/" %%A IN (%TranslationFile%) DO RENAME "%%B" "%%A"
        DEL /F /Q %TranslationFile%
    )