Jump to content

malayvanti

Member
  • Posts

    5
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

Everything posted by malayvanti

  1. Almost there!! Error on line 33, char 6 - "File already exists". You have been awesome to troubleshoot this with me, thanks.
  2. That resolved that error, now I get error 800A03EA, "syntax error" on line 17, char 4. Thank you very much for your help thus far.
  3. OK so I tried that script and got error 800A0401 - expected end of statement on Line 1 Char 9. Any ideas?
  4. Sorry to resurrect this thread but I had a question about the script listed above. Dim objFSO, ofolder, objStream Set objShell = CreateObject("WScript.Shell") Set objFSO = CreateObject("scripting.filesystemobject") Set objNet = CreateObject("WScript.NetWork") Set FSO = CreateObject("Scripting.FileSystemObject") '=====Source folder===== SPath = "C:\Source\" ShowSubfolders FSO.GetFolder(spath) Sub ShowSubFolders(Folder) For Each Subfolder in Folder.SubFolders CheckFolder(subfolder) ShowSubFolders Subfolder Next End Sub Sub CheckFolder(objCurrentFolder) Dim strTempL, strTempR, strSearchL, strSearchR, objNewFolder, objFile Const OverwriteExisting = TRUE For Each objFile In objCurrentFolder.Files FileName = objFile '=====Destination folder===== objFSO.MoveFile FileName, "C:\Destination\" Next End Sub How can I adapt this to work for multiple folders; i.e. moving from e:\backup\serverA to e:\serverA, e:\backup\serverB to e:\serverB, etc. I tried to add multiple folders to the script by copying from the '==Source folder line down and then changing source/destination folders. It works in that it moves the files out of the subfolders, but it will dump them into the last folder specified in the script, for example, it will move the contents of e:\backup\serverA, e:\backup\serverB .... and put it in e:\serverZ. If serverY is the last server listed in the script, it will dump there. How do I get them to abide by the different destinations in the script? Hope that makes sense. Thanks!
×
×
  • Create New...