Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with folders need help

Status
Not open for further replies.

Councilk

MIS
May 14, 2003
72
US
Hello all

I have the follwing folder structure I would like to manipulate.

1. I have C:\PPress with 5 sub folders
2. I want to bakup the entire folder before I update two of the subfolders with PDF files

This is what I have so far

Option Explicit
On error resume next

Dim objFso, objfolder, objShell, numFolders, FolderPath, -
FolderPrefix, FolderPrefix1, i

numFolder = 5
FolderPath = "C:\PPress"
FolderPrefix1 = "PPressBak"

For i = 1 to numFolders

Set objFSo = CreateObject("Scripting.FileSystemObject")

If objFso.FolderExists(FolderPath & FolderPrefix & i) Then
Wscript.echo("Type code to backup folders")
Wscript.echo("Copy new PDF to subFolders")
End If

Next

I don't think I need all the code here and trying to get the logic and syntax correct

Thanks for any assistance in my learning this code it's been great....





 
As is you are building strings like:

"C:\PPressPPressBak1"
"C:\PPressPPressBak2"
"C:\PPressPPressBak3"
"C:\PPressPPressBak4"
"C:\PPressPPressBak5"

Add a backslash here:
FolderPath = "C:\PPress[red]\[/red]"

Then take a look at the objFSO folder copy method.


I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top