Ask the Expert

Constructing statement to copy one file to desktop

I have a batch file to copy files from a CD to the hard drive for an application. I want one file to be copied to the desktop. I am using Windows XP. How do I construct the copy statement?

Requires Free Membership to View

There's no easy way to do this in a single copy statement. I'd create a batch file that would do the bulk of the copying first using the XCOPY command, and then one more COPY command to copy the single file you need on the desktop. If you wanted that particular file not to appear in the other folders you copied, you could also then append a DEL statement to get rid of the extra copy of the file that's not on the desktop.

This was first published in February 2006

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: