![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| Newbie | coping jpg files from computer help Hello All, I am very green with VBS, so i appologize in advance. I am trying to figure out how to write a VBS to scan a particular extension (i.e. *.jpg or *.doc) on my entire hard drive (C including subfolders and copy them to a single folder on the computer or a USB drive. i want to be able to change the extension as needed or if it is possible be able to copy multiple extensions, also a completion message would be really nice. Hopefully this is possible.Thanks in advance |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: coping jpg files from computer help "keeping" <guest@xxxxxx-email.com> wrote in message news:ff1036493a10cd0aff0407e83bc8d001@xxxxxx-gateway.com... Quote: > > Hello All, > I am very green with VBS, so i appologize in advance. I am trying to > figure out how to write a VBS to scan a particular extension (i.e. *.jpg > or *.doc) on my entire hard drive (C including subfolders and copy> them to a single folder on the computer or a USB drive. i want to be > able to change the extension as needed or if it is possible be able to > copy multiple extensions, also a completion message would be really > nice. Hopefully this is possible. > Thanks in advance > > > -- > keeping quick and easy solution) or to learn about VB Scripting (in which case I recommend that you download the help file script56.chm from the Microsoft site). This file contains all the basic VB Script functions and methods, complete with examples. |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: coping jpg files from computer help "Pegasus [MVP]" <news@xxxxxx> wrote in message news:uUDbIXA8JHA.2656@xxxxxx Quote: > > "keeping" <guest@xxxxxx-email.com> wrote in message > news:ff1036493a10cd0aff0407e83bc8d001@xxxxxx-gateway.com... Quote: >> >> Hello All, >> I am very green with VBS, so i appologize in advance. I am trying to >> figure out how to write a VBS to scan a particular extension (i.e. *.jpg >> or *.doc) on my entire hard drive (C including subfolders and copy>> them to a single folder on the computer or a USB drive. i want to be >> able to change the extension as needed or if it is possible be able to >> copy multiple extensions, also a completion message would be really >> nice. Hopefully this is possible. >> Thanks in advance >> >> >> -- >> keeping > Is your aim to just copy the files (in which case a batch file would be a > quick and easy solution) or to learn about VB Scripting (in which case I > recommend that you download the help file script56.chm from the Microsoft > site). This file contains all the basic VB Script functions and methods, > complete with examples. > SubFolder and the Files collections. Remember to exclude the folder you are copying to from the search or things may go pear shaped ![]() -- Joe Fawcett (MVP - XML) http://joe.fawcett.name |
My System Specs![]() |
| | #4 (permalink) |
| Guest | Re: coping jpg files from computer help "Joe Fawcett" <joefawcett@xxxxxx> wrote in message news:uI$pDzA8JHA.1380@xxxxxx Quote: > > "Pegasus [MVP]" <news@xxxxxx> wrote in message > news:uUDbIXA8JHA.2656@xxxxxx Quote: >> >> "keeping" <guest@xxxxxx-email.com> wrote in message >> news:ff1036493a10cd0aff0407e83bc8d001@xxxxxx-gateway.com... Quote: >>> >>> Hello All, >>> I am very green with VBS, so i appologize in advance. I am trying to >>> figure out how to write a VBS to scan a particular extension (i.e. *.jpg >>> or *.doc) on my entire hard drive (C including subfolders and copy>>> them to a single folder on the computer or a USB drive. i want to be >>> able to change the extension as needed or if it is possible be able to >>> copy multiple extensions, also a completion message would be really >>> nice. Hopefully this is possible. >>> Thanks in advance >>> >>> >>> -- >>> keeping >> Is your aim to just copy the files (in which case a batch file would be a >> quick and easy solution) or to learn about VB Scripting (in which case I >> recommend that you download the help file script56.chm from the Microsoft >> site). This file contains all the basic VB Script functions and methods, >> complete with examples. >> > Specifically look at FileSystemObject and GetFolder together with the > SubFolder and the Files collections. > Remember to exclude the folder you are copying to from the search or > things may go pear shaped ![]() may have identical names. You will need to either rename these so they do not conflict, or place them in different folders on the USB drive. /Al |
My System Specs![]() |
| | #5 (permalink) |
| Guest | Re: coping jpg files from computer help There are some similar scripts here that you should be able to adapt: www.jsware.net/jsware/scripts.php5#recur Quote: > > Hello All, > I am very green with VBS, so i appologize in advance. I am trying to > figure out how to write a VBS to scan a particular extension (i.e. *.jpg > or *.doc) on my entire hard drive (C including subfolders and copy> them to a single folder on the computer or a USB drive. i want to be > able to change the extension as needed or if it is possible be able to > copy multiple extensions, also a completion message would be really > nice. Hopefully this is possible. > Thanks in advance > > > -- > keeping |
My System Specs![]() |
| | #6 (permalink) |
| Guest | Re: coping jpg files from computer help "keeping" <guest@xxxxxx-email.com> wrote in message news:ff1036493a10cd0aff0407e83bc8d001@xxxxxx-gateway.com... Quote: > > Hello All, > I am very green with VBS, so i appologize in advance. I am trying to > figure out how to write a VBS to scan a particular extension (i.e. *.jpg > or *.doc) on my entire hard drive (C including subfolders and copy> them to a single folder on the computer or a USB drive. i want to be > able to change the extension as needed or if it is possible be able to > copy multiple extensions, also a completion message would be really > nice. Hopefully this is possible. > Thanks in advance could manually open a search window and have it list all the .jpg files. This search also can go at least one level deep into .zip and .cab compressed files, which can be handy at times. You could then start your ..VBS file which would use the shell.application object to find the search window, and from there drill down to the shell folder object that represents the search window. This shell folder object has a folderItems property which gives you a collection of all the items in the search window. The script could then go through the collection and perhaps weed out duplicate files based on file name, size, or file checksum (CRC-32 and/or SHA-1 with Microsoft's command line tool fciv.exe). You might still have collisions - files with identical names and with different contents, from different original folders, and the script could count these and decide on an appropriate number of folders to hold the duplicate file names. Once all this is done, the script could copy the files one by one from their original folders to the appropriate destination folder. I think Vista's file search is too different from WXP's for this approach to work on Vista, but it is possible that it can be done there too. I am working on a similar project right now on WXP. -Paul Randall |
My System Specs![]() |
| | #7 (permalink) |
| Guest | Re: coping jpg files from computer help Quote: > You could then start your > .VBS file which would use the shell.application object to find the search > window, and from there drill down to the shell folder object that Quote: > the search window. object represents an Explorer window, not the file system. It can't be depended upon to return all files in a folder. Much better to use FSO. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Coping whole HD's without cloning. | Vista file management | |||
| Coping Email | Vista General | |||
| Can't view shared files on XP computer from Vista Home Premium computer | Vista networking & sharing | |||
| How to setup Username/Password for a drive in a Windows XP computer to backup files from a Vista computer? | Vista General | |||
| Can only access Public Files on Vista computer from XP computer | Vista networking & sharing | |||