There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
DOS/PDA/Other
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Operating Systems > DOS/PDA/Other >
Solved: Batch File help - XCOPY command


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
trippnwo's Avatar
Junior Member with 4 posts.
 
Join Date: Jun 2007
04-Jun-2007, 09:44 AM #1
Solved: Batch File help - XCOPY command
Hi,

My work is trying to run a batch file and is having problems getting it to work properly.

It is supposed to go to the D:\ drive - then to the fkormos\files\ directory.

Once there, it should copy all the files in fkormos\files into all the directories in the 5 commands below.

It should then delete all the files in the original directory and close.

Attached is a screen shot of what it does.

This batch file is stored in fkormos\files and a user logs in VIA ftp, then uploads the files to that directory, then runs the batch file. We are testing it on a machine where the user has full privileges on everything.

The drives X and F are networked drives.

Any help is greatly appreciated.

Thanks - Alan


d:
cd\fkormos\files
xcopy d:\fkormos\files\*.* d:\fkormos\files\bk\
xcopy d:\fkormos\files\*.* x:\bk\faye\
xcopy d:\fkormos\files\*.* x:\files\
xcopy d:\fkormos\files\*.* d:\archive\
xcopy d:\fkormos\files\*.* f:\Backup\
echo Y | del d:\fkormos\files\
exit
Attached Thumbnails
solved-batch-file-help-xcopy-batch-2.jpg  
JohnWill's Avatar
Computer Specs
Moderator with 77,380 posts.
 
Join Date: Oct 2002
Location: South Eastern PA, USA
Experience: Advanced age & experience
04-Jun-2007, 10:11 AM #2
Let's see:

You have no space between the cd and the \fkormos\files in this command: d\fkormos\files

Both the X: and F: drives appear to not be recognized, so there's something wrong with the mapping, or those folders don't exist on the target drives. See the invalid drive specification errors for any copy to those drives.

There are no files in the folder d:\fkormos\files\, so nothing is copied.
__________________
Microsoft MVP - User Desktop Experience

If you think experts are expensive, wait until you see what amateurs cost you!

Help me out with some details here, I'm brilliant, not clairvoyant!
trippnwo's Avatar
Junior Member with 4 posts.
 
Join Date: Jun 2007
04-Jun-2007, 10:28 AM #3
thanks - i didn't even notice that...

the drives are all mapped.

Are the directory paths case sensitive?
trippnwo's Avatar
Junior Member with 4 posts.
 
Join Date: Jun 2007
04-Jun-2007, 11:18 AM #4
hi - just wanted to let you know I got it running locally but it wont run when I log in VIA ftp...

just to take a stab at it, here is a screen shot of serv-u and the mapping properties (image removed). I think it has to do with the fact that the x:\files is being mapped as files...

what do you think? How could it be run if serv-u sees X:\Files\ as Files

Last edited by trippnwo : 04-Jun-2007 12:55 PM.
trippnwo's Avatar
Junior Member with 4 posts.
 
Join Date: Jun 2007
04-Jun-2007, 12:55 PM #5
i figured it out

I had to define a command in the FTP client in order to run it.

site exec /username/username.bat

works like a champ now -

thanks for the help.
JohnWill's Avatar
Computer Specs
Moderator with 77,380 posts.
 
Join Date: Oct 2002
Location: South Eastern PA, USA
Experience: Advanced age & experience
04-Jun-2007, 02:44 PM #6
Glad you found a solution.

You can mark your own threads solved using the thread tools at the upper right of the screen.©
jcdizon103178's Avatar
Junior Member with 2 posts.
 
Join Date: May 2008
21-May-2008, 09:22 PM #7
xcopy command
Hi. James here from Philippines. is there anyone can help me with xcopy command in DOS Batch File. Actually, i can successfully copy files from one drive to another drive..
My command is here
xcopy c:\test d:\test /e /i /y /d

My question now is, is there a way that i can have a log file that will give me informations that the files were copied with date and time specified?
i have tested

xcopy c:\test d:\test /e /i /y /d > log.txt

but it only gives me info that the files were copied and no specified date and time.


your help is very much appreciated.
-james
TheOutcaste's Avatar
Computer Specs
Senior Member with 1,646 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
22-May-2008, 04:27 PM #8
It's best to start a new thread rather than adding onto an old one, especially if it's marked solved. I almost didn't look at this.

Anyways, just echo the date and time to the file first. Also helps to add a seperator if you are going to be reusing the log.txt file. Note the doubled greater than symbols (>>), this will append to the log.txt file, rather than creating a new one:
Code:
Echo. >>log.txt
echo.---------------------------------- >>log.txt
echo %date% %time% >>log.txt
echo.---------------------------------- >>log.txt
Echo. >>log.txt
xcopy c:\test d:\test /e /i /y /d >> log.txt
Running the batch twice in a row results in this:

Code:
---------------------------------- 
Thu 05/22/2008 13:23:56.53 
---------------------------------- 
 
C:\test\big 1.txt
C:\test\modtst.cmd
C:\test\ptst.cmd
C:\test\times.txt
C:\test\times2.txt
C:\test\tst.cmd
6 File(s) copied
 
---------------------------------- 
Thu 05/22/2008 13:25:26.44 
---------------------------------- 
 
0 File(s) copied
__________________
Of course I know all the answers ; I just don't always match the answers to the right questions

Warning -- Windows spoken here. (Rated R for Strong Language and Violence -- When your Windows PC flies through a window, that's violent, right?)
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 10:17 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.