Re: How to copy(not redirect) IE fav to network drive
- From: "Pegasus \(MVP\)" <I.can@xxxxxxx>
- Date: Wed, 10 May 2006 18:12:32 +1000
"Håvard via WinServerKB.com" <u9071@uwe> wrote in message
news:60080cd1046c5@xxxxxx
I am using this cmd file to copy to the network drive:error
@echo off
cd /d c:\
cd %userprofile%
xcopy favoritter /h /s /y h:\favoritter
exit
I thought that this script should cover my problem, but I get a syntax
(in cmd) when I run it
cd /d h:\
copy h:\favoritter /h /s /y %userprofile%\Favoritter
exit
Any clues?
--
Message posted via http://www.winserverkb.com
There are a few problems with your batch file:
- The line "cd /d h:\" is superfluous. Delete it!
- The copy command does not have a /s switch
and it will not copy subdirectories. Use xcopy.exe
instead.
- "%UserProfile%" has embedded spaces. You must
therefore enclose it with double quotes (which you
should do for all file & folder names in order to make
your batch files more robust.
- You should add a backslash to the target directory,
to ensure that xcopy will create it in case it does not
exist.
- You may want to add the /d switch so that old files
do not get copied each time.
Try this:
@echo off
xcopy h:\favoritter /h /s /y /d "%userprofile%\Favoritter\"
.
- Follow-Ups:
- Re: How to copy(not redirect) IE fav to network drive
- From: Håvard via WinServerKB.com
- Re: How to copy(not redirect) IE fav to network drive
- References:
- How to copy(not redirect) IE fav to network drive
- From: Håvard via WinServerKB.com
- Re: How to copy(not redirect) IE fav to network drive
- From: Pegasus \(MVP\)
- Re: How to copy(not redirect) IE fav to network drive
- From: Håvard via WinServerKB.com
- How to copy(not redirect) IE fav to network drive
- Prev by Date: Re: How to copy(not redirect) IE fav to network drive
- Next by Date: Re: How to copy(not redirect) IE fav to network drive
- Previous by thread: Re: How to copy(not redirect) IE fav to network drive
- Next by thread: Re: How to copy(not redirect) IE fav to network drive
- Index(es):
Relevant Pages
|