hidden hit counter
Welcome to WindowsForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

q; move files to another server

 
   Windows XP (Home) -> Windows XP Arch -> Windows XP General Arch3 RSS
Next:  Screensaver & Power options Windows XP  
Author Message
jimh2

External


Since: Dec 08, 2004
Posts: 5



(Msg. 1) Posted: Thu Sep 07, 2006 3:23 pm
Post subject: q; move files to another server
Archived from groups: microsoft>public>windowsxp>general (more info?)

Hi,
I need to find all the *.xls files in the current and sub folders and copy
all the *.xls to a different server with the same folder structure and then
delete only *.xls in the source folders by keeping the folders.
How can I do this in a batch or a vbscript?



Was this post helpful to you?

Why

 >> Stay informed about: q; move files to another server 
Back to top
Login to vote
Jon48

External


Since: Jul 10, 2004
Posts: 358



(Msg. 2) Posted: Fri Sep 08, 2006 12:38 am
Post subject: Re: q; move files to another server [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

xcopy /?
del /?

--
Jon

The sharper the storm, the sooner it's over

It cannot be denied that "JIM.H." clearly
stated in
> Hi,
> I need to find all the *.xls files in the current and sub folders and copy
> all the *.xls to a different server with the same folder structure and
> then
> delete only *.xls in the source folders by keeping the folders.
> How can I do this in a batch or a vbscript?
>
>
>
> Was this post helpful to you?
>
> Why
>

 >> Stay informed about: q; move files to another server 
Back to top
Login to vote
jimh2

External


Since: Dec 08, 2004
Posts: 5



(Msg. 3) Posted: Fri Sep 08, 2006 6:00 am
Post subject: Re: q; move files to another server [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Jon,
Thanks for the reply, how can I delete *.xls files in the sub folders
without deleting the folder?



"Jon" wrote:

> xcopy /?
> del /?
>
> --
> Jon
>
> The sharper the storm, the sooner it's over
>
> It cannot be denied that "JIM.H." clearly
> stated in
> > Hi,
> > I need to find all the *.xls files in the current and sub folders and copy
> > all the *.xls to a different server with the same folder structure and
> > then
> > delete only *.xls in the source folders by keeping the folders.
> > How can I do this in a batch or a vbscript?
> >
> >
> >
> > Was this post helpful to you?
> >
> > Why
> >
>
>
 >> Stay informed about: q; move files to another server 
Back to top
Login to vote
q_q_anonymous

External


Since: Jun 11, 2005
Posts: 75



(Msg. 4) Posted: Fri Sep 08, 2006 7:40 am
Post subject: Re: q; move files to another server [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

JIM.H. wrote:
> Hi,
> I need to find all the *.xls files in the current and sub folders and copy
> all the *.xls to a different server with the same folder structure and then
> delete only *.xls in the source folders by keeping the folders.
> How can I do this in a batch or a vbscript?
>
>

HMM

I'm sure that xcopy will scan through the subdirectories and find all
the xls files, but i'm not sure whether it can copy them to the
corresponding subdirectories.

To do this right, you don't want to touch the destination structure in
any other way.
So, you don't jut want to overwrite everything in the destination.

a barmy way that'd do it would be to copy the whole lot, somehow
*prompting for* every single file copy(even if the file doesnt' exist
at the destination), and then only *confirm* for the xls files.

another way woudl be fsync. It'll pick up the xls files to transfer
and copy them to the correspondign structure. You then choose which to
transfer. . I think. I don't use fsync much.

Hey , I know!!
i've never doen this but i've planned on it.
you use attrib and xcopy
the solution is to do with
attrib /a
and xcopy /a and /m

You can use attrib, so that when xcopy runs it'll only copy certain
files of your choosing.

It should copy them to the corresponding structure because you'd tell
it to copy the whole parent source directory including subfolders. to
the destination. And it'd only copy the files specified

traditionally the attrib /a and xcopy /a/m are to do with backus. So
you are telling xcopy that certain files in the source directory have
been amended and so should be copied. The rest haven't been amended and
so shouldn't be copied. It's done like that to save time..

hmm,. actually there's still a weakness there. It'll copy files in
source that aren't in dest. So, you'll tell it to only copy *.xls.
now it's fine.

You don't need a batch file of vbscript..

To delete all xls files going through the subfolders. There are 2
ways..
There was a time when pc magazine came up with a program called sweep,
which would run a command in subdirectories.
So sweep del *.xls
But I think the FOR command will do it. You can tell it to recurse
through subdirectories look for - say - *.xls, and run whatever
command.

>
> Was this post helpful to you?
>
> Why


yes.. just don't charge for the solution on some commercial site!!

experts-exchange are enough of a nuisance doing that.
 >> Stay informed about: q; move files to another server 
Back to top
Login to vote
q_q_anonymous

External


Since: Jun 11, 2005
Posts: 75



(Msg. 5) Posted: Fri Sep 08, 2006 7:48 am
Post subject: Re: q; move files to another server [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Bob I wrote:
> Why do you believe the folders would get deleted if the command was
>
> DEL *.xls
>
> ????????
>

he said he wanted to go through subdirectories. So del wouldn't do it.

in the DOS days (win98 DOS and before, like DOS 6.22 and before that)
there was deltree.

that'd have deleted the directories.
..
win xp doesn't have deltree. It has rmdir (or rmdir /s), which would
also delete the directory.

sweep.com , or using the for command with the del command. Or writing
a qbasic program to do it, are not so obvious. Well, the qbasic
program might be Wink But it's not generally done in win xp. I haven't
used it for years anyway !


note- it seems old DOS, along with the decent deltree command, had a
rather impotent rmdir that couldn't delete non empty directories !!
http://www.vfrazee.com/ms-dos/6.22/help/rmdir.htm#Notes

note2-
dir /b/s gets all the paths of all xls files.
you could redirect that to a file. dir /b/s >a
How to then delete those files listed in a?
Well, you could bounce off the command prompt. - isntead of using
qbasic with the SHELL command.
 >> Stay informed about: q; move files to another server 
Back to top
Login to vote
q_q_anonymous

External


Since: Jun 11, 2005
Posts: 75



(Msg. 6) Posted: Fri Sep 08, 2006 8:31 am
Post subject: Re: q; move files to another server [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Jon wrote:
> del *.xls /s
>
> That will delete the .xls files in subdirectories, but preserve the
> directory structure.
>
> --
> Jon
>

thanks Jon

this is very significant. I hadn't realised that windows xp had updated
the del command!!

in msdos 6.22 you didn't have that option
http://www.vfrazee.com/ms-dos/6.22/help/del.htm

Is there a list of amendemnts of commands from msdos 6.22 to windows
xp?

I don't mean new commands, I mean switches added to old ones. Or
functionality changing in some way.


(I don't know about NT. As far as I know , del /s is an XP innovation)
 >> Stay informed about: q; move files to another server 
Back to top
Login to vote
Bob I

External


Since: Jun 14, 2004
Posts: 2929



(Msg. 7) Posted: Fri Sep 08, 2006 9:08 am
Post subject: Re: q; move files to another server [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Why do you believe the folders would get deleted if the command was

DEL *.xls

????????

JIM.H. wrote:

> Hi Jon,
> Thanks for the reply, how can I delete *.xls files in the sub folders
> without deleting the folder?
>
>
>
> "Jon" wrote:
>
>
>>xcopy /?
>>del /?
>>
>>--
>>Jon
>>
>>The sharper the storm, the sooner it's over
>>
>>It cannot be denied that "JIM.H." clearly
>>stated in
>>
>>>Hi,
>>>I need to find all the *.xls files in the current and sub folders and copy
>>>all the *.xls to a different server with the same folder structure and
>>>then
>>>delete only *.xls in the source folders by keeping the folders.
>>>How can I do this in a batch or a vbscript?
>>>
>>>
>>>
>>> Was this post helpful to you?
>>>
>>> Why
>>>
>>
>>
 >> Stay informed about: q; move files to another server 
Back to top
Login to vote
Jon48

External


Since: Jul 10, 2004
Posts: 358



(Msg. 8) Posted: Fri Sep 08, 2006 4:05 pm
Post subject: Re: q; move files to another server [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

del *.xls /s

That will delete the .xls files in subdirectories, but preserve the
directory structure.

--
Jon

Give us the tools and we will finish the job
--Winston Churchill

It's certainly worth mentioning that "JIM.H."
had previously written the following in
message
> Hi Jon,
> Thanks for the reply, how can I delete *.xls files in the sub folders
> without deleting the folder?
>
>
>
> "Jon" wrote:
>
>> xcopy /?
>> del /?
>>
>> --
>> Jon
>>
>> The sharper the storm, the sooner it's over
>>
>> It cannot be denied that "JIM.H."
>> clearly
>> stated in
>> > Hi,
>> > I need to find all the *.xls files in the current and sub folders and
>> > copy
>> > all the *.xls to a different server with the same folder structure and
>> > then
>> > delete only *.xls in the source folders by keeping the folders.
>> > How can I do this in a batch or a vbscript?
>> >
>> >
>> >
>> > Was this post helpful to you?
>> >
>> > Why
>> >
>>
>>
 >> Stay informed about: q; move files to another server 
Back to top
Login to vote
Jon48

External


Since: Jul 10, 2004
Posts: 358



(Msg. 9) Posted: Fri Sep 08, 2006 4:53 pm
Post subject: Re: q; move files to another server [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

You are probably correct. It's a number of years since I've spent a long
time with DOS, and I tend to forget commands I learned a year ago, let alone
5 - 10 years ago Smile

This may get you started if you want to research it in more depth
http://en.wikipedia.org/wiki/MS-DOS

--
Jon

There are tricks in every trade

It cannot be denied that clearly stated in

>
> Jon wrote:
>> del *.xls /s
>>
>> That will delete the .xls files in subdirectories, but preserve the
>> directory structure.
>>
>> --
>> Jon
>>
>
> thanks Jon
>
> this is very significant. I hadn't realised that windows xp had updated
> the del command!!
>
> in msdos 6.22 you didn't have that option
> http://www.vfrazee.com/ms-dos/6.22/help/del.htm
>
> Is there a list of amendemnts of commands from msdos 6.22 to windows
> xp?
>
> I don't mean new commands, I mean switches added to old ones. Or
> functionality changing in some way.
>
>
> (I don't know about NT. As far as I know , del /s is an XP innovation)
>
 >> Stay informed about: q; move files to another server 
Back to top
Login to vote




User: inactive
Posts:



(Msg. 10) Posted: Sat Sep 09, 2006 6:12 am
Post subject: Re: q; move files to another server [Login to view extended thread Info.]

Hi Jim
I really can't believe this debate has gone on to 8 replies. In it's simplest form this will do the job but it would be safer to either "stop on error" or have two batch files.

@echo off
cls
rem Replace "X" with your network drive
xcopy c:\dir1\dir2\*.xls X:\dir1\dir2 /s /v
del c:\dir1\dir2\*.xls /s

Jon was right that the "/s" addition with the Del cmd in XP really helps.

Hope this sorts you out.
 >> Stay informed about: q; move files to another server 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Move XP to a new computer - I purchased a stand alone full version of XP Pro service pack 2 and still have the entire package/CD etc. It was installed on a computer that is having problems and will be exchanged for a new computer. What do I need to do so that I can reinstall..

Move row string to column - Hello I need help to the column string to row. Here is the example of the data.Thanks (Policy DB1 Backup Policy for backup time 10:30 AM today Job Configuration Run the policy continuously up to a frequency of every 15 minutes Using LiveVault Agent..

How do you move the "Address Register"? - Does anybody know how to the change the location of the data file for the "Address Register"? I assume it's got to be done through the registry. I wish to change its location to a partition other than the Windows partition. ...

Bone Head move requires Copy and Edit DAT file - I know I have done the ULTIMATE SIN. I screwed with the registry without making a backup. The machine boots fine but won’t allow me to log on, I know where the mistake is (outside of not making a BACKUP). Through the recovery council can I copy the..

PC cant find server - using win xp pro, I run microtrend housecall to scan for malware, not soon after I could not connect to the internet (blueyonder) either email or websites.I have tried system restore. the pc tells me it has a connection and working online, so I am..
   Windows XP (Home) -> Windows XP Arch -> Windows XP General Arch3 All times are: Eastern Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Categories:
  Windows XP
 Win 2000/NT/98/ME
 Windows Vista!


[ Contact us | Terms of Service/Privacy Policy ]