You are kidding right? Try this (you type it at the command prompt - Start|Run|cmd.exe):

C:\>copy /? Copies one or more files to another location. COPY [/V] [/N] [/Y | /-Y] [/Z] [/A | /B ] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination [/A | /B]] source Specifies the file or files to be copied. /A Indicates an ASCII text file. /B Indicates a binary file. destination Specifies the directory and/or filename for the new fil +e(s). /V Verifies that new files are written correctly. /N Uses short filename, if available, when copying a file +with a non-8dot3 name. /Y Suppresses prompting to confirm you want to overwrite a +n existing destination file. /-Y Causes prompting to confirm you want to overwrite an existing destination file. /Z Copies networked files in restartable mode. The switch /Y may be preset in the COPYCMD environment variable. This may be overridden with /-Y on the command line. Default is to prompt on overwrites unless COPY command is being executed from within a batch script. To append files, specify a single file for destination, but multiple f +iles for source (using wildcards or file1+file2+file3 format). C:\>

So to do it just type (say this) at the command prompt:

copy blabla.jpg c:\games copy .\*.jpg c:\all_jpegs

The DOT dir is the current dir and * is a wildcard that matches anything so .\*.jpg means match anything in the current directory that ends in .jpg. You can call shell from perl like this using backtics

#!/usr/bin/perl `copy blabla.jpg c:\\games`;

NOTE you need 2 backslashes everyhwere you want a single backslash because of the special nature of the \ char in strings ie \n is a newline and \\ is a literal backslash.

You can also use the File::Copy module which has the advantage of working across operating systems although somehow I don't see that as a likely issue for you.

#!/usr/bin/perl use File::Copy; copy( 'file1', 'file2' );
<code>

cheers

tachyon


In reply to Re: Copy from the curent directory to... by tachyon
in thread Copy from the curent directory to... by freak

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.