I'm a bit flat out at the moment and I just need this script to work around a problem we are having with our OSD image through SCCM.
It is supposed to be a simple script that is called from a batch file in a client build task sequence. It is supposed to delete the default user profile in the C:\Users directory and copy a working Default user profile from the source directory where the script is run from. At this point I get a "path not found" error when I execute it, regardless of whether it is run off the network or locally on the PC.
This is what I have:
strDeleteFolder = "C:\Users\Default\"
strSourceFolder = "Default"
strDestFolder = "C:\Users\"
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFolder strSourceFolder, strDestFolder, True
set objFolder = objFSO.GetFolder(strDeleteFolder)
objFolder.Attributes = objFolder.Attributes XOR 2
Obviously when I am testing this I am logged in, so I have copied the directories and renamed them to Default1 so I can delete the the target directory. When this is deployed through the task sequence the C:\Users\Default directory will be unlocked and this fix can take place (I can do it manually).
If someone could help me out on where I am going wrong here, it would be greatly appreciated.