Re: Script to Move All Files in First Folder to A Second Folder by Jessi
Jessi
Sun Apr 08 17:57:56 CDT 2007
I appreciate your help, Marcus, but I am brand new at this, so I guess
I'm missing something very, very basic. I am currently
experimenting with this at home so the file/folder names will be
different. Here is what I need to do:
Delete all files located in Folder2 (but leave Folder2 intact).
Move all files located in Folder1 to Folder2 (but leave Folder1
intact).
This is what I've done so far: I created a text file on my desktop,
then renamed it to "Batch.bat" The batch file contains the
following lines:
*********Begin Script
Option Explicit
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFile "C:\Documents and Settings\Marcia\Desktop\*Folder2*",
True
'Clean Up Above Variables:
Set oFSO = Nothing
'Move All Files in Folder1 to Folder2:
Move /Y "C:\Documents and Settings\Jessi\Desktop\Folder1" "C:
\Documents and Settings\Jessi\Desktop\Folder2"
********End Script
When I doubleclick the batch file, here is what actually happens:
It does NOT delete the files in Folder2.
It moves the entire Folder1 folder into Folder2 (not just the files).
Do you see anything wrong with the "deletion" portion of the script?
How can I move the files ONLY (and not the folder too)?
Thanks so much for any help!
Jessi