Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Subject: Command Prompt - Transferring Files

Original Message
Name: McRibisBack
Date: April 29, 2008 at 05:06:24 Pacific
Subject: Command Prompt - Transferring Files
OS: Windows XP Professio
CPU/Ram: AMD 64 --1GB Tam
Comment:
I want to create a batch file (utilizing the command prompt) that would go to 1 drive, copy the contents of a folder within that drive. Then go to another drive, delete the contents of a folder there and replace (copy) the files from drive 1 into it.

I've read a few command prompt tutorials, but haven't come across how to copy files over like this. Is there one out there? I know this is simple, but things are always hard until you learn how to do them!

Thanks,

"No matter how hard you try, you can't baptize cats."


Report Offensive Message For Removal

Response Number 1
Name: timexed
Date: April 29, 2008 at 05:12:30 Pacific
Subject: Command Prompt - Transferring Files
Reply: (edit)
Use the following command in a batch file.

C:\move /
Moves files and renames files and directories.

To move one or more files:
MOVE [/Y | /-Y] [drive:][path]filename1[,...] destination

To rename a directory:
MOVE [/Y | /-Y] [drive:][path]dirname1 dirname2

[drive:][path]filename1 Specifies the location and name of the file
or files you want to move.
destination Specifies the new location of the file. Destination
can consist of a drive letter and colon, a
directory name, or a combination. If you are moving
only one file, you can also include a filename if
you want to rename the file when you move it.
[drive:][path]dirname1 Specifies the directory you want to rename.
dirname2 Specifies the new name of the directory.

/Y Suppresses prompting to confirm you want to
overwrite an existing destination file.
/-Y Causes prompting to confirm you want to overwrite
an existing destination file.

The switch /Y may be present in the COPYCMD environment variable.
This may be overridden with /-Y on the command line. Default is
to prompt on overwrites unless MOVE command is being executed from
within a batch script.

one time, some time, all the time...All about the past moment


Report Offensive Follow Up For Removal

Response Number 2
Name: wanderer
Date: April 30, 2008 at 12:16:35 Pacific
Subject: Command Prompt - Transferring Files
Reply: (edit)
Move doesn't fit the OP's criteria

rem #first establish drive maps
net use x: \\pc1\sharename\folder1
net use y: \\pc2\sharename\folder2

rem #now you delete the contents
y:
delete *.* /y

rem #now you copy the contents of folder1 to folder2 [/s is for subfolders if they exist]
xcopy x:\*.* /s

exit

Imagine the power of knowing how to internet search
http://www.lib.berkeley.edu/Teachin...


Report Offensive Follow Up For Removal

Response Number 3
Name: timexed
Date: May 1, 2008 at 04:46:51 Pacific
Subject: Command Prompt - Transferring Files
Reply: (edit)
Looks like you have the solution right there; except for destination directory in xcopy command line...
1. Why do you need to delete all of the contents of Y:\?

2. Is the data from X:\ newer versions of data from Y:\?

3. What errors are you getting when you run the command?

one time, some time, all the time...All about the past moment


Report Offensive Follow Up For Removal

Response Number 4
Name: McRibisBack
Date: May 2, 2008 at 04:22:56 Pacific
Subject: Command Prompt - Transferring Files
Reply: (edit)
I work in an office environment and we use many web favorites. However, the auto-start on each PC is set to a specific format that resets our Favorites every morning when we log in. So I wanted to create a batch file I could throw in the start-up that would automatically delete the useless favorites (about 40) and replace them with our department specific favorites (about 10) to be more organized.

"No matter how hard you try, you can't baptize cats."


Report Offensive Follow Up For Removal

Response Number 5
Name: timexed
Date: May 2, 2008 at 05:39:00 Pacific
Subject: Command Prompt - Transferring Files
Reply: (edit)
Xcopy will definately work I did not read all of your criteria...
If you have your favorites folder stored locally or on a shared drive you could just change the path to your users favorites folder in the registry to always read your favorites folder.

In the registry:

My Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

Edit the Favorites entry to point to where your favorites location is.

one time, some time, all the time...All about the past moment


Report Offensive Follow Up For Removal

Response Number 6
Name: McRibisBack
Date: May 2, 2008 at 07:48:25 Pacific
Subject: Command Prompt - Transferring Files
Reply: (edit)
that would be MUCH better! However, our computers are locked down tight. I cannot run the command prompt to run "RegEdit". Is there another way to modify my registry. I REALLY appreciate your help!!!

"No matter how hard you try, you can't baptize cats."


Report Offensive Follow Up For Removal

Response Number 7
Name: wanderer
Date: May 2, 2008 at 08:12:25 Pacific
Subject: Command Prompt - Transferring Files
Reply: (edit)
"except for destination directory in xcopy command line..."

timexed you don't need a distination because by default it will copy to the present location which in this case is y:

McRibisBack if that is all you want to do is edit favorites why not talk to your IT dept? Surely they can help.

Imagine the power of knowing how to internet search
http://www.lib.berkeley.edu/Teachin...


Report Offensive Follow Up For Removal

Response Number 8
Name: McRibisBack
Date: May 2, 2008 at 08:32:02 Pacific
Subject: Command Prompt - Transferring Files
Reply: (edit)
Well, I work for a bank and our profiles are all under the same umbrella, which totals around 10,000 associates. So to ask them to do so would mean they would have to do it for all the LOBs and they weren't to keep on the idea. So, I was going to make a batch file and toss it in the start-up so our group can at least have what they need.

"No matter how hard you try, you can't baptize cats."


Report Offensive Follow Up For Removal

Response Number 9
Name: timexed
Date: May 4, 2008 at 05:13:03 Pacific
Subject: Command Prompt - Transferring Files
Reply: (edit)
"except for destination directory in xcopy command line..."

Thank you wanderer; I mispoke, after I went back and read some notes I realized the mistake. As for fixing the registry when you don't have acess to the command prompt. You can create the change on your computer and export the key and save it as a .reg file. After you make the change right click on the User Shell Folders and Export save to location as .reg file. Bring this registry file to work and double click on it. It will change only that entry on your computer. If your locked down too much you might not have access to change the registry as a domain user.

one time, some time, all the time...All about the past moment


Report Offensive Follow Up For Removal



Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Command Prompt - Transferring Files

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software



Version Tracker Pro
Keep your software current and secure, effortlessly

Click Here for a Free Scan

Driver Agent
Automatically find the latest drivers for your computer.
Click Here for a Free Scan



The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC