Jump to content
sleyer

Nak Create Bat File Delete File

Recommended Posts

halo, aku ade server dan ade lebih 12 folder yg berbeza

so aku nak delete file2 sampah, mcm .mp3, .tmp

[CODE]
cls
rem THIS WILL DELETE ALL:
rem [.FAS]
rem UPDATED ON 03-DECEMBER-2010
del A:\*.fas /s/f
del B:\*.fas /s/f
del G:\*.fas /s/f
del H:\*.fas /s/f
del I:\*.fas /s/f
del J:\*.fas /s/f
del K:\*.fas /s/f
del L:\*.fas /s/f
del M:\*.fas /s/f
del N:\*.fas /s/f
del O:\*.fas /s/f
del P:\*.fas /s/f
del Q:\*.fas /s/f
del R:\*.fas /s/f
del V:\*.fas /s/f
del W:\*.fas /s/f
del X:\*.fas /s/f
[/CODE]

coding ni ok jer..

persoalan aku adelah mcm mane aku nak buat tuk delete file2 mcm balala.pic sasa.mp3 dalam c:\ pc user ? dalam masa sama exlude folder program file

Share this post


Link to post
Share on other sites
[quote name='akubudakbaik' timestamp='1338793172' post='1082542']
del /s /q c:\user\*.pic *.mp3 *.apaapaje
[/quote]

aku just nak exlude folder program file jer... lain2 include

Share this post


Link to post
Share on other sites
[CODE]del /s /q c:\user\*.pic *.mp3 *.apaapaje[/CODE]

buang /s. /s bersamaan sub-folder.
tambah /a. /a bersamaan all files.

[CODE]del /a /q c:\user\*.pic *.mp3 *.apaapaje[/CODE]

Share this post


Link to post
Share on other sites
[quote name='Null' timestamp='1339246677' post='1082685']
[CODE]del /s /q c:\user\*.pic *.mp3 *.apaapaje[/CODE]

buang /s. /s bersamaan sub-folder.
tambah /a. /a bersamaan all files.

[CODE]del /a /q c:\user\*.pic *.mp3 *.apaapaje[/CODE]
[/quote]

batch ni akan delete file dalam c: folder user kan ? cam ne nak exlude program file ?

Share this post


Link to post
Share on other sites
[CODE]@echo off
cd "C:\WINDOWS"
del /s /q *.mp3
cd ..
cd "C:\Documents and Settings"
del /s /q *.mp3[/CODE]

ko boleh buat [b]for loop[/b] untuk exclude folder, tapi x pasti boleh ke tak sebab [b]del /s[/b] tu pun dah looping.. kalau boleh pun mungkin nk kena perah otak sikit.. tapi cara coding atas tu pun dah ok.. copy paste kat notepad dan save as clean.bat

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...