Link to home
Create AccountLog in
Avatar of chasmant
chasmant

asked on

vbscript that will copy folders to C:\temp and then a script that will copy back to original place

I could use some help
I need a script that will copy
C:\Documents and Settings\"current users folder"\Application Data\Microsoft\Outlook
C:\Documents and Settings\"Current users folder"\Application Data\Microsoft\Internet Explorer
C:\Documents and Settings\"Current users folder"\Application Data\Microsoft\Signatures
to the C:\temp folder

then a script that will copy them back and over write the folders that maybe there now after I recreate their profile
Avatar of chasmant
chasmant

ASKER

Windows XP
Can you explain why you want a script to do this?  As chasmant said:

"Windows XP"

You can move/copy/delete profiles manually from the user profiles menu.
I think this should do what you're looking for:
Set WshShell = WScript.CreateObject("WScript.Shell") 
strSrcRoot = WshShell.ExpandEnvironmentStrings("%APPDATA%") & "\Microsoft\"
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
Dim MovFolders(3)

MovFolders(0) = "Outlook"
MovFolders(1) = "Internet Explorer"
MovFolders(2) = "Signatures"

for i = 0 to 2
	srcFolder = strSrcRoot & MovFolders(i)
	TargetFolder = "C:\Temp\" & MovFolders(i)
	FSO.CopyFolder srcFolder, TargetFolder
Next

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of morganmce
morganmce
Flag of Ireland image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
thanks this worked perfect