I think you will need to give more information, particularly about the files and directories to/from which you are copying.

When Microsoft introduced Server 2008 and Windows Vista they changed the names of several "special folders". If you look in Explorer the old folders will still be there, but you cannot work with them like normal files because they are junction points. You can make your scripts more portable between Windows OS versions by using the Win32 module. This module contains tools for generating the correct pathname from CSIDLs. Although CSIDLs are deprecated for Vista and Server 2008, they still can be used. As Win32 has not been updated to work with KNOWNFOLDERIDs, CSIDLs are probably your best way to insure portability.

A second gotcha as people move scripts from XP to Vista/Server 2008 is security. Vista has a much more elaborate security system than XP and many actions that were once allowed by any user can now only be done when the script is running as administrator. In some cases you will need to interactively approve an action - see UAC for more information. I haven't done much Perl work on Vista/Server 2008 so I don't know how the permissions issues play out, but I know that an awful lot of cygwin scripts and programs would silently fail because the underlying C libraries didn't know how to prompt interactively for permission.

The usual work around for these situations is to run as administrator to begin with. Most scripts will run OK this way. Though perhaps not all. If your Perl script runs an unsigned installation program, my recollection is that Vista/Server2008 will still prompt for permission even if you are running as administrator. If that happens and your script is not prepared for it, once again it may silently fail.

When all else fails, some people have turned off UAC. However, that defeats the purpose of the new security system and is not recommended, especially in a server environment.

Best, beth


In reply to Re: File::Copy on Windows 2008 by ELISHEVA
in thread File::Copy on Windows 2008 by paulchernoch

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.