Temizlik betiği oluşturma

mahoni55555

Kilopat
Katılım
4 Haziran 2017
Mesajlar
321
Çözümler
2
Daha fazla  
Cinsiyet
Erkek
Belirlediğim klasör içindeki dosyların .bat ile silinmesini istiyorum. Fakat pek bilgi sahibi olmadığım bir konu olduğu için sürekli hatalar ile karşılaşıyorum. Yardımcı olabilir misiniz? Betiğin başta evet hayır sorması gerekli.

C:\Windows\Temp
C:\Users\PC-BIL~1\AppData\Local\Temp
C:\Users\PC-Bilgisayar\Recent
C:\Windows\Prefetch
D:\Games\Zula (bu klasörde ack.log ve login.ini dosyaları)
D:\Games\Zula\log (tüm .log uzantılı dosyalar)
D:\Games\Zula\game\logs (tüm .log uzantılı dosyalar)
D:\Games\Zula\screenshots (tüm .JPG ve .pnguzantılı dosyalar)
 
[CODE title="komut"]
set /P c=Silinsin mi? [E/H]?
if /I "%c%" EQU "E" goto :somewhere
if /I "%c%" EQU "H" goto :somewhere_else
goto :choice

:somewhere
:choice
del /f /q /s C:\Windows\Temp
del /f /q /s C:\Users\PC-BIL~1\AppData\Local\Temp
del /f /q /s C:\Users\PC-Bilgisayar\Recent
del /f /q /s C:\Windows\Prefetch
del /f /q /s D:\Games\Zula\ack.log
del /f /q /s D:\Games\Zula\login.ini
del /f /q /s D:\Games\Zula\game\logs\*.log*
del /f /q /s D:\Games\Zula\screenshots\*.jpg*
del /f /q /s D:\Games\Zula\screenshots\*.png*
echo "Silindi."

:somewhere_else
echo "Silinmedi"[/CODE]

Bu komutu metin belgesini yapıştırıp farklı kaydet deyip .bat olarak kaydedin.
Evet hayır zorunlu ise değiştiriyorum bekleyin.
 
[CODE title="komut"]
set /P c=Silinsin mi? [E/H]?
if /I "%c%" EQU "E" goto :somewhere
if /I "%c%" EQU "H" goto :somewhere_else
goto :choice

:somewhere
:choice
del /f /q /s C:\Windows\Temp
del /f /q /s C:\Users\PC-BIL~1\AppData\Local\Temp
del /f /q /s C:\Users\PC-Bilgisayar\Recent
del /f /q /s C:\Windows\Prefetch
del /f /q /s D:\Games\Zula\ack.log
del /f /q /s D:\Games\Zula\login.ini
del /f /q /s D:\Games\Zula\game\logs\*.log*
del /f /q /s D:\Games\Zula\screenshots\*.jpg*
del /f /q /s D:\Games\Zula\screenshots\*.png*
echo "Silindi."

:somewhere_else
echo "Silinmedi"[/CODE]

Bu komutu metin belgesini yapıştırıp farklı kaydet deyip .bat olarak kaydedin.
Evet hayır zorunlu ise değiştiriyorum bekleyin.
Teşekkürler deneyeceğim.
 

Geri
Yukarı