Vicki05
-
Total Posts
:
8
- Scores: 0
-
Reward points
:
0
- Joined: 1/15/2012
-
Status: offline
|
Copy subfolders that have variable names
Wednesday, January 25, 2012 6:04 AM
( permalink)
Hi All, I am having an issue copying sub folders with variable names. With a batch file, I was able to copy sub folders and its contents without any issues by putting a wild card. How can I do that in vbscripting? The root folder has sub folders that I need to copy and some ini files and exe that I do not want to. Could someone please point me in the right direction. Any help is appreciated. Vicki
|
|
|
|
ebgreen
-
Total Posts
:
8219
- Scores: 98
-
Reward points
:
0
- Joined: 7/12/2005
-
Status: offline
|
Re:Copy subfolders that have variable names
Wednesday, January 25, 2012 6:28 AM
( permalink)
Well it will depend in part on how exactly you are trying to do the copy. When you are asking questions, including the pertinent code along with any errors and indicating the specific line that the error refers to will always help.
|
|
|
|
Vicki05
-
Total Posts
:
8
- Scores: 0
-
Reward points
:
0
- Joined: 1/15/2012
-
Status: offline
|
Re:Copy subfolders that have variable names
Wednesday, January 25, 2012 10:48 AM
( permalink)
HI Ebgreen, I am new at vbs and have long ways to go. This is what I have to copy the folder. It copies the root folder plus everything in it when I just need to copy the subfolders. I have been searching on how to copy the subfolders that have variable folder names and had no luck. dim filesys set filesys=CreateObject("Scripting.FileSystemObject") If filesys.FolderExists("C:\Program Files\Tango\") Then filesys.CopyFolder "C:\Program Files\Tango", "d:\TEST\" End If
|
|
|
|
ebgreen
-
Total Posts
:
8219
- Scores: 98
-
Reward points
:
0
- Joined: 7/12/2005
-
Status: offline
|
Re:Copy subfolders that have variable names
Wednesday, January 25, 2012 3:25 PM
( permalink)
According to the documentation, .CoppyFolder supports wild names. http://msdn.microsoft.com/en-us/library/xbfwysex.aspx If that does not appear to work for you, the next option is to get the collection of subfolders iterating through it and explicitly copying each one.
|
|
|
|