Vbscript delete files based on extension on a drive

Right now i use this batch script to delete files based on extension on drive D: and all folder and subfolder on it every computer restart.
@echo off
del /F /S /Q D:\*.jpg            
del /F /S /Q D:\*.mp3
del /F /S /Q D:\*.lnk
del /F /S /Q D:\*.bmp
I need to change that batch script in to vbscript with same function.
Help me please..
sorry for my english..

righ now i used batch file on startup windows xp, but i want to use vbscript because the cmd will be disable on plan. my batch script like this.
As mentioned in your duplicated thread, respondents in this forum will gladly help posters with their script problems but they do not write scripts on demand. Here are a couple of options for you:
Learn how to write VBScripts or PowerShell.
Run the job as a scheduled task at boot time under an account other than the logon account.

Similar Messages

  • Deleting files permanently through LightRoom on external drive

    My LR files are stored on an external drive and the drive is called Buffalo NAS and it has a "trashbox" for deleted files.  My IT says I should clean out the trashbox using LR and I can not figure out how to do this.  I do not want deleted files eating up hard drive space on the external.  This forum as been great for answering my other questions and I thank all in advance who might help with this.
    JWT

    Hi JWT
    LR only manages the folders you have selected for import and development (editing).
    If you want to use LR to delete “managed” folders it’s possible to select them in the Library (Folders tab) and then remove and optionally delete from your hard drive or NAS.

  • PowerShell Script to Delete Files Based on Current Date

    I know by using Get-Date PowerShell will look at the current date.  I would like to make a very basic PS Script which will delete a file older than 8 days based on the current day.  I believe using a if/then function will be necessary. 
    I am very new to scripting so Im not sure how the syntax is written.  All help appreciated.

    Yes, use -Recurse to get subfolders too:
    $Folder = "C:\Users\Me\Backups"
    Get-ChildItem -Path $Folder -Recurse |
    Where { $_.LastWriteTime -lt [DateTime]::Today.AddDays(-8) } |
    Sort LastWriteTime |
    Remove-Item $_ -Force -Confirm:$false
    Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable) _________________________________________________________________________________
    Powershell: Learn it before it's an emergency http://technet.microsoft.com/en-us/scriptcenter/powershell.aspx http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx

  • Unix command to delete files with .cache extension

    I was wondering if anyone knew of a unix command that can be sent to another computer that will delete all files on the hard drive with a certain extension such as .cache.
    Like: rm *.cache
    Thank you!

    Well, I don't recommend it, but if you want to fubar the computer, send this as root:
    find / -name "*.cache" -exec rm -f {} \;

  • How can I delete files based on it's file name

    I have a folder with almost 3000 jpg files. They were downloaded from a website that I am migrating. Over half of the files are duplicates that are just resized as thumbnails. Each thumbnail's name ends with "_t". Is there a quick way to delete every file in the folder that ends with "_t"?

    I have a folder with almost 3000 jpg files. They were downloaded from a website that I am migrating. Over half of the files are duplicates that are just resized as thumbnails. Each thumbnail's name ends with "_t". Is there a quick way to delete every file in the folder that ends with "_t"?

  • Delete files from an External Serial ATA Drive

    I have an external Serial ATA drive with a windows operating system connected to my macbook pro by a usb adapter. I'm trying to delete some files from the drive but it tells me it is read only. How do I change the sharing and permissions?

    You can't write/make changes to an NTFS formatted drive using a Mac without third party software.
    Search Google for "Mac NTFS"

  • How can I delete files from iTunes AND my hard drive? It used to be very obvious in iTunes but I no longer see that option.

    I used to easily be able to delete songs from my hard drive and library through iTunes but I no longer see that option. Is there a way to do that or a workaround of some kind?

    Are these songs in the iTunes media folder shown in iTunes prefs > Advanced?
    Only songs in this location will be deleted from the HD when delting from iTunes.
    Also, iTunes prefs > Advanced.
    Click Reset Warnings.
    If you are deleting from a playlist, it will only delete from that playlist.
    Hold Shift and press Delete to remove from the playlist and from the library.

  • How do I delete files from my 21 TB SimpleSave Drive?

    My sim;le save 1 TB drive cannot back up anymore because it is full. i can't find where to delete data.

    Dave, welcome to the forum.
    Which of these drives is yours?
    Signature:
    HP TouchPad - 1.2 GHz; 1 GB memory; 32 GB storage; WebOS/CyanogenMod 11(Kit Kat)
    HP 10 Plus; Android-Kit Kat; 1.0 GHz Allwinner A31 ARM Cortex A7 Quad Core Processor ; 2GB RAM Memory Long: 2 GB DDR3L SDRAM (1600MHz); 16GB disable eMMC 16GB v4.51
    HP Omen; i7-4710QH; 8 GB memory; 256 GB San Disk SSD; Win 8.1
    HP Photosmart 7520 AIO
    ++++++++++++++++++
    **Click the Thumbs Up+ to say 'Thanks' and the 'Accept as Solution' if I have solved your problem.**
    Intelligence is God given; Wisdom is the sum of our mistakes!
    I am not an HP employee.

  • [SOLVED] Delete recursively all files with certain extensions

    Hi all,
    I am trying to recursively delete files with specific extensions. Many of these files have names containing spaces. The following, that I found googling around, didn't work:
    find /media/TSUNAMI -name '*out' -or -name '*aux' -or -name '*log' -or -name '*.blg' -or -name '*.toc' -or -name '*.bcf' -or -name '*.swp' -or -name '*blx' | rm
    find /media/TSUNAMI -name '*out' -or -name '*aux' -or -name '*log' -or -name '*.blg' -or -name '*.toc' -or -name '*.bcf' -or -name '*.swp' -or -name '*blx' -type f -ok rm '{}' ';'
    find /media/TSUNAMI -name '*out' -or -name '*aux' -or -name '*log' -or -name '*.blg' -or -name '*.toc' -or -name '*.bcf' -or -name '*.swp' -or -name '*blx' -exec rm -f '{}' \;
    find /media/TSUNAMI -name '*out' -or -name '*aux' -or -name '*log' -or -name '*.blg' -or -name '*.toc' -or -name '*.bcf' -or -name '*.swp' -or -name '*blx'| xargs /bin/rm -f
    find /media/TSUNAMI -name '*out' -or -name '*aux' -or -name '*log' -or -name '*.blg' -or -name '*.toc' -or -name '*.bcf' -or -name '*.swp' -or -name '*blx' -exec /bin/rm -f '{}' \;
    find /media/TSUNAMI -name '*out' -or -name '*aux' -or -name '*log' -or -name '*.blg' -or -name '*.toc' -or -name '*.bcf' -or -name '*.swp' -or -name '*blx'| xargs -0 rm
    and I think that it was the following that deleted all the files (except the directories):
    find /media/TSUNAMI -name '*out' -or -name '*aux' -or -name '*log' -or -name '*.blg' -or -name '*.toc' -or -name '*.bcf' -or -name '*.swp' -or -name '*blx' -type f -delete
    What am I doing wrong here?
    Thanks a lot in advance.
    PS. While writing this I realized that I fogot the dot in out, aux, log, and blx
    PS2. I'm experimenting around and don't mind deleting all the files if I do a mistake
    Last edited by geo909 (2014-09-30 06:12:04)

    geo909 wrote:Thanks so much. So  what is different when we group those options with \( \)?
    The implicit "and" operator binds stronger than the "or" (-o) operator. Therefore
    | -name a -o -name b -delete |
    will be grouped like this: 
    | (-name a) -o ( -name b -delete ) | .
    You want to group it like this: 
    | ((-name a ) -o ( -name b )) ( -delete )   | ,
    so you need to add some manual grouping: 
    | ( -name a -o -name b ) -delete |
    Last edited by progandy (2014-09-30 05:52:29)

  • How to delete  File from the Application Server,ABAP

    Hi Gurus,
    I'm using  DELETE  DATASET  Statement ,
    Based on Date  how can i delete files with in the period in the Application server
    Any BAPI/FM  for this Delete file based  on some Date Period
    Thanks in Advance.

    DATA: BEGIN OF file,
            dirname(75) TYPE c, " name of directory. (possibly truncated.)
            name(75)    TYPE c, " name of entry. (possibly truncated.)
            type(10)    TYPE c,            " type of entry.
            len(8)      TYPE p,            " length in bytes.
            owner(8)    TYPE c,            " owner of the entry.
            mtime(6)    TYPE p, " last modification date, seconds since 1970
            mode(9)     TYPE c, " like "rwx-r-x--x": protection mode.
            useable(1)  TYPE c,
            subrc(4)    TYPE c,
            errno(3)    TYPE c,
            errmsg(40)  TYPE c,
            mod_date    TYPE d,
            mod_time(8) TYPE c,            " hh:mm:ss
            seen(1)     TYPE c,
            changed(1)  TYPE c,
          END OF file.
    DATA: BEGIN OF file_list OCCURS 100,
            dirname(75) TYPE c, " name of directory. (possibly truncated.)
            name(75)    TYPE c, " name of entry. (possibly truncated.)
            type(10)    TYPE c,            " type of entry.
            len(8)      TYPE p,            " length in bytes.
            owner(8)    TYPE c,            " owner of the entry.
            mtime(6)    TYPE p, " last modification date, seconds since 1970
            mode(9)     TYPE c, " like "rwx-r-x--x": protection mode.
            useable(1)  TYPE c,
            subrc(4)    TYPE c,
            errno(3)    TYPE c,
            errmsg(40)  TYPE c,
            mod_date    TYPE d,
            mod_time(8) TYPE c,            " hh:mm:ss
            seen(1)     TYPE c,
            changed(1)  TYPE c,
          END OF file_list.
      DO.
        CLEAR file.                           
        CALL 'C_DIR_READ_NEXT'
          ID 'TYPE'   FIELD file-type
          ID 'NAME'   FIELD file-name
          ID 'LEN'    FIELD file-len
          ID 'OWNER'  FIELD file-owner
          ID 'MTIME'  FIELD file-mtime
          ID 'MODE'   FIELD file-mode
          ID 'ERRNO'  FIELD file-errno
          ID 'ERRMSG' FIELD file-errmsg.
       if sy-subrc eq 0.
          MOVE-CORRESPONDING file TO file_list.
          APPEND file_list.
       else.
          exit.
       endif.
    enddo.
    sort file_list based on date and time ie, MOD_DATE and MOD_TIME fields
    and delete the entries

  • Cover Flow view is out-of-sync after deleting files

    If you move a file to the trash while in Cover Flow, the file's contents are still displayed but the file is gone. Then as you use the arrow keys to move up and down, the file names continue to be out of sync with the content that's being displayed.
    The only way to sync them back up again is to change views or flip to another folder and flip back.
    If you continue to delete files based on the content you're looking at, you'll end up deleting the wrong files.

    I tried watching them in the timeline and viewer, all out of sync. No external monitor. I did get a message once about dropped frames and something else, it said I might have these issues, but it didn't tell me to change settings, just told me it was gonna happen, lol. So, I don't know where to start to fix it.

  • Prevent recovery of deleted files on SSD?

    Borrowing a OS X 10.8.5 Air while I wait for a Pro replacement. Three days later I decide that it would be prudent to secure empty trash.
    Another day later I decide to run Disk Drill just to see what might be unearthed. Everything and more.
    I can't be sure I will be writing over those files as I will need to return the Air shortly.
    As far as I understand it with the SSDs, booting into recovery mode will offer only a complete secure erase, not the erase free space option? Or am I wrong?
    If not, are there some permanent erase options that I can be sure won't wipe out the entire hard drive as well as cost a great deal?
    TIA

    Disk Drill, and all other file recovery apps for the Mac will recover every deleted file it can find on the drive. However, it should not have been at all possible to recover the ones you deleted with Secure Empty Trash. All files currently in the trash have every bit of their data overwritten 7 times with random data.
    Were these part of what was recovered? Or just other normally deleted items?

  • Disk utility to prevent the recover of deleted files / empty trash securely

    I just used the disk utility to prevent the recover of deleted files...
    It created a recovery folder which I tried to empty trash securely...i the got a message saying there are some locked items and I responded to remove all items...
    It would not let me do that the file stayed in the trash until I changed the setting and just emptied the trash the conventional way..
    Can anyone tell me why that is happening???

    Disk Drill, and all other file recovery apps for the Mac will recover every deleted file it can find on the drive. However, it should not have been at all possible to recover the ones you deleted with Secure Empty Trash. All files currently in the trash have every bit of their data overwritten 7 times with random data.
    Were these part of what was recovered? Or just other normally deleted items?

  • If I delete files from my computer, do they remain on the time capsule and how do I access them?

    If I delete files from my computer's hard drive do they remain on time capsule? Where? How do I access them?

    So long as the deleted files have been backed up to Time Machine then they will be there for you to acces in the following manner:
    From the Time Machine icon in the Menu Bar click and hold to expose the drop-down menu. Select "Enter Time Machine". [The Time Machine volume must be attached to your Mac, of course, otherwise this procedure will not work.] Once you are in Time Machine go to the date when you remember the file being on your internal drive; you can also do a Search for the file name. Once the file has been located you highlight it and click "Replace" and the file will be replaced; if a file of the same name is in the exact same location you will be presented with the option to replace or keep both.

  • Script to select files in a folder based on extension

    Does anyone have a script that would select files in a folder based on extension, then move the files somewhere else?

    Hi Kagey and welcome!
    You have to be completely accurate about the path. If your hard disk is called "Macintosh HD", then it's
    every file of folder "Macintosh HD:Applications:FileMaker Pro 6 Folder" whose name extension = "tab"
    You can generalise this for other users if you can't be sure about the name of their hard disk:
    set apps_folder to path to applications folder as string
    set fmp_folder to apps_folder & "FileMaker Pro 6 Folder"
    tell application "finder" to get every file of folder fmp_folder whose name extension = "tab"
    HTH
    H
    PS - well done in the footy

Maybe you are looking for

  • [MaterializedView] : "mv references a synonym in the FROM list "

    I want to create fast refreshable MV using synonym. First of all it does allow to create fast refreshable MV using synonym. I have created MV using force option. While using DBMS_MVIEW.EXPLAIN_MVIEW to know capability of the MV , i found that "REFRES

  • ChaRM - Message not appearing in CRM Web Client

    Hi My company is using ChaRM and have ZMCR setup for Change Requests. Due to audit reasons, the requester and approver in ZMCR cannot be the same person. I have gone into SE91 and access message class SOCM_ACTION_LOG. Here, I have created my new mess

  • Can't setup account on Itunes

    I bought my g/f an Ipod for christmas. She uses Windows XP and when trying to sign up for her account on Itunes it always says credit card processing is not avaliable at that time. We have been trying since Dec 22 and as of this morning it still isn'

  • How to validate for 2 decimal places

    How can I put a check while inserting into a number(5,2) field that user has entered only 2 decimal places. Right now if the user inserts records like 23.5456 it gets inserted as 23.56 . I want these type of records to error out. Is there an easy way

  • N86 8mp having language problem

    I am using n86 8mp,I updated my  software but only English & Chinese language is coming,I needed ARABIC language ,so pls help me,