You need to use the absolute path in both the mkdir call and the rename call. the following two lines will make the the script current working directory (cwd) the directory you specify. You'll also not that I have used forward slashes rather than doubled backslashes. The result is the same, but this is rather more readable I think. This will work for all pathnames within Perl, even on Win32 (and other DOS-like systems as the pod would have it:).

use Cwd 'chdir'; chdir '//10.1.1.5/Weblogiclogs';

Alternatively, simply prepend the directory name to the filename as in

my $createdir = '//10.1.1.5/Weblogiclogs' . strftime( '%y%d%e%H%M%S', +localtime);

As for where the directory you created was created and the files moved to, that will depend what the cwd was at the time. If you had run the script from the command line, it would have been the same as the directory you were in when you ran it? At least under any circumstances I can think of.

As for where the directory/files that you created/moved are - probably the easiest way to find them would be to use the Start->Find...->Files or Folders... option and enter the name of the directory you created.


Cor! Like yer ring! ... HALO dammit! ... 'Ave it yer way! Hal-lo, Mister la-de-da. ... Like yer ring!

In reply to Re: Re: Re: Re: Re: Please help - problem with script on Win2K by BrowserUk
in thread Please help - problem with script on Win2K by Anonymous Monk

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.