vbscript to copy and delete files with conditions RRS feed

  • Question

  • Hi

    I have two scenarios for which I need vbscript. Please remember I am a novice but have great interest to learn.

    Question 1:

    Need a script to copy and paste multiple files from one folder to another if any of the below folders/locations exist or all locations exist.
    example: (should be able to overwrite if files already exists)
    File: t1.txt from %userprofile%/desktop to %userprofile\startmenu or %userprofile%\AppData\Local\Microsoft\Office or E:/stuff
    File: t2.pdf from %userprofile%/desktop to %userprofile\startmenu or %userprofile%\AppData\Local\Microsoft\Office or E:/stuff
    File: t3.dot from %userprofile%/desktop to %userprofile\startmenu or %userprofile%\AppData\Local\Microsoft\Office or E:/stuff

    Question 2:

    Need a script to delete  multiple files with different names and extensions after searching all drives on the computer.
    Delete template.pdf from %userprofile%/desktop/data
    Delete work.docx from %userproifle%/appdata/microsoft/office/
    Delete google.lnk from e:/store/linksfolder/
    Delete yahoo.url from d:/stuff/newfolder1/

    Tuesday, January 22, 2013 7:07 PM