SoftwareTipsandTricks Forum

Go Back   SoftwareTipsandTricks Forum > Software > Software Problems and Useful Utilities
User Name
Password


Batch file to move a file

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes

  #1  
Old 11-02-2005, 12:21 PM
WorldBuilder Offline
Registered User
 
Join Date: Nov 2005
Posts: 19
Batch file to move a file

Hi all,

I'm no batch file expert. I want to write one that will copy a file from one location to another. Currently, I have this:

Code:
xcopy C:\Documents and Settings\cbartlett\My Documents\My Pictures\untitled.bmp G:\scans

The G drive is a network drive. I've tried a great many variations of this from what I could find in the help for xcopy but nothing is working. The file is not copied when this batch file is executed.

What's wrong?

Thanks!

Chris
Reply With Quote

  #2  
Old 11-03-2005, 06:22 AM
pip22's Avatar
pip22 Offline
Registered User
 
Join Date: Jun 2004
Location: United Kingdom
Posts: 1,297
XCOPY is a DOS utility and as such it cannot read/write folder names or filenames which use more than 8 characters (plus the 3 extension characters), and cannot read spaces. In your case, the filename is okay, but the folder names in the path are too long and have spaces. When writing the command, you need to use the short folder names as DOS sees them. probably something like this:
xcopy c:\documen1\cbartlet\mydocum1\mypictu1\untitled.bm p
I'm only guessing cos I don't use DOS anymore, you would need to to look at a folder listing in DOS to check how DOS interprets the long folder names exactly, but I think I'm very near the mark. Incidentally, it won't work at all in Windows XP on an NTFS partition if that's what you're running. XCOPY cannot read files on an NTFS partition because FAT (which DOS uses) and NTFS are incompatible.

Last edited by pip22 : 11-03-2005 at 06:27 AM.
Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
nero startsmart problem stoo999 Hardware Problems 7 08-09-2006 12:20 PM
A little help needed cdb252 Windows XP 0 06-23-2005 02:15 PM
Error: File in Use, cannot move or restore file Soots Windows XP 1 05-30-2005 02:28 AM
rewriter not working! skoundrel Windows XP 6 05-29-2005 02:31 PM
Deleting a file using a batch file in Windows scheduler JP-D Windows NT/2000/2003 2 05-01-2005 03:07 PM



All times are GMT -5. The time now is 04:19 AM.


Designed by eXtremepixels. Powered by vBulletin Version 3.5.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 2.3.2 © 2005, Crawlability, Inc.