Hello...

I need to move all the files in a network folder (\\bmd-fax\faxes) to
a second folder (\\bmd-fax\new). This will be done repeatedly
throughout the day, so I would like to do it with a script that is
assigned to a desktop icon.

We are using Windows XP computers on a Microsoft Server 2003
network. Does anyone know how to do that with a script?

Thanks so much for any help possible.

Jessi

Re: Script to Move All Files in First Folder to A Second Folder by Marcus

Marcus
Tue Apr 03 00:39:15 CDT 2007

Hi Jessi,

if you only want to move the files I
would use the simple DOS command "move"...

move /Y "\\bmd-fax\faxes" "\\bmd-fax\new"

It not works recursively (!)

Marcus





Jessi schrieb:
> Hello...
>
> I need to move all the files in a network folder (\\bmd-fax\faxes) to
> a second folder (\\bmd-fax\new). This will be done repeatedly
> throughout the day, so I would like to do it with a script that is
> assigned to a desktop icon.
>
> We are using Windows XP computers on a Microsoft Server 2003
> network. Does anyone know how to do that with a script?
>
> Thanks so much for any help possible.
>
> Jessi
>

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


Re: Script to Move All Files in First Folder to A Second Folder by Jessi

Jessi
Sun Apr 08 18:34:51 CDT 2007

OK... I kept playing around with this, then realized that I was mixing
VBScript commands with DOS commands (see... I told you I was brand
new! Ha!).

Anyway, the following lines in a batch file appear to work for me.

REM DELETE ALL FILES IN FOLDER2
CD "C:\Documents and Settings\Marcia\Desktop\Folder2"
Del *.*

REM MOVE ALL FILES IN FOLDER1 TO FOLDER2
Move "C:\Documents and Settings\Marcia\Desktop\Folder1\*.*" "C:
\Documents and Settings\Marcia\Desktop\Folder2"

THANKS for pointing me in the right direction with the "Move" command.

Jessi