Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Xcopy and batch file problem

Thread Tools
 
Search this Thread
 
Old 28 May 2003, 04:41 PM
  #1  
Jer
Scooby Regular
Thread Starter
 
Jer's Avatar
 
Join Date: Nov 2000
Location: Glasgow
Posts: 1,432
Likes: 0
Received 0 Likes on 0 Posts
Post

I am trying to write a small batch file that copies a directory from the C drive to the E drive.

The Code

xcopy source "C:\company" destination "e:\company"

I then save this as a .bat file and run it. When I run it, it just loops until I stop it.

any ideas

Cheers

Jeremy
Old 28 May 2003, 04:47 PM
  #2  
NickAdams
Scooby Regular
iTrader: (5)
 
NickAdams's Avatar
 
Join Date: Mar 2001
Location: Cheshire
Posts: 2,895
Likes: 0
Received 0 Likes on 0 Posts
Post

You only need quotes (") if the directory names are over 8 characters long or have spaces in em!

ie c:\company instead of "c:\company"

Nick
Old 28 May 2003, 04:49 PM
  #3  
Jer
Scooby Regular
Thread Starter
 
Jer's Avatar
 
Join Date: Nov 2000
Location: Glasgow
Posts: 1,432
Likes: 0
Received 0 Likes on 0 Posts
Post

Cheers nick

I have tried that but it's still doing the same.
Old 28 May 2003, 04:50 PM
  #4  
4lex L
Scooby Regular
 
4lex L's Avatar
 
Join Date: Apr 2003
Posts: 110
Likes: 0
Received 0 Likes on 0 Posts
Post

Try xcopy C:\company\*.* e:\company\ /s

The /s will copy the directory and all subdirectories, replace with /e is you want to copy empty ones as well.
Old 28 May 2003, 05:03 PM
  #5  
Jer
Scooby Regular
Thread Starter
 
Jer's Avatar
 
Join Date: Nov 2000
Location: Glasgow
Posts: 1,432
Likes: 0
Received 0 Likes on 0 Posts
Post

Nope, it's still doing it. I think I may have a problem with DOS?
Old 28 May 2003, 05:07 PM
  #6  
stevencotton
Scooby Regular
 
stevencotton's Avatar
 
Join Date: Jan 2001
Location: behind twin turbos
Posts: 2,710
Likes: 0
Received 1 Like on 1 Post
Post

More likely the use of DOS, than a problem with DOS itself
Old 28 May 2003, 05:40 PM
  #7  
David_Wallis
Scooby Regular
 
David_Wallis's Avatar
 
Join Date: Nov 2001
Location: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
Posts: 15,239
Likes: 0
Received 1 Like on 1 Post
Post

how you calling the batch file, and from what??

What O/S??
Old 28 May 2003, 07:14 PM
  #8  
Miles
Scooby Regular
 
Miles's Avatar
 
Join Date: Oct 1998
Location: The Granite City/Dallas, Tx.
Posts: 2,519
Likes: 0
Received 0 Likes on 0 Posts
Post

Have you looked at Robocopy - its in the NT and W2K Resource Kits....
Old 28 May 2003, 07:16 PM
  #9  
Jer
Scooby Regular
Thread Starter
 
Jer's Avatar
 
Join Date: Nov 2000
Location: Glasgow
Posts: 1,432
Likes: 0
Received 0 Likes on 0 Posts
Post

It's Windows 2000 SBS. I have tried putting the batch file into sheduled tasks and double clicking it.
Old 28 May 2003, 10:49 PM
  #10  
David_Wallis
Scooby Regular
 
David_Wallis's Avatar
 
Join Date: Nov 2001
Location: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
Posts: 15,239
Likes: 0
Received 1 Like on 1 Post
Post

try doing it with a cmd file.. I also recommend robocopy as xcopy is pooh.
Old 28 May 2003, 11:44 PM
  #11  
ChristianR
Scooby Regular
iTrader: (1)
 
ChristianR's Avatar
 
Join Date: May 2001
Location: Europe
Posts: 6,329
Likes: 0
Received 1 Like on 1 Post
Post

does e:\company exist?

if not..

--start of bat--

e:
cd\
mkdir company
xcopy c:\company\*.* e:\company\*.* /e /v /h

--end of bat--
Old 29 May 2003, 03:43 PM
  #12  
Jer
Scooby Regular
Thread Starter
 
Jer's Avatar
 
Join Date: Nov 2000
Location: Glasgow
Posts: 1,432
Likes: 0
Received 0 Likes on 0 Posts
Post

I have tried the code on other PC's and it works okay. It's a bit worrying as this is a new server I am building for work.
Old 29 May 2003, 03:51 PM
  #13  
David_Wallis
Scooby Regular
 
David_Wallis's Avatar
 
Join Date: Nov 2001
Location: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
Posts: 15,239
Likes: 0
Received 1 Like on 1 Post
Post

whats worrying, the fact you cant write a batch file or that your building a server?

Can you open a cmd prompt without problems..

Your not using start to do it are you??

Re-apply service packs and see if that does anything..

David
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
PetrolHeadKid
Driving Dynamics
10
05 October 2015 05:19 PM
T.K
General Technical
10
02 October 2015 11:35 AM
yabbadoo4
ScoobyNet General
11
30 September 2015 10:33 PM
Nick_Cat
Computer & Technology Related
2
26 September 2015 08:00 AM
Littleted
Computer & Technology Related
0
25 September 2015 08:44 AM



Quick Reply: Xcopy and batch file problem



All times are GMT +1. The time now is 01:05 PM.