in reply to Re: Moving folders
in thread Moving folders

As I said I am pretty new at this so I am sure I am missing something but i tried this code just to test it out
#!/usr/bin/perl

$defaultdir = 'C:\Documents and Settings\Tim\My Documents\test1'; # Directory containing original folders
$destinationdir = 'C:\Documents and Settings\Tim\My Documents\test2'; # Directory to copy folders to
$matchedfolder ='foo'; # a folder name in test1

system "move /y $defaultdir/$matchedfolder $destinationdir";

i run it and i get the msg
"The syntax of the command is incorrect"

Replies are listed 'Best First'.
Re^3: Moving folders
by Tanktalus (Canon) on Mar 10, 2005 at 01:07 UTC

    Here we're dealing with two programs: perl and move. Actually, on Windows, I think move is merely part of CMD.EXE. You need to format your input into move from perl such that move (or CMD.EXE) understands it. And it doesn't get spaces properly.

    system qq(move /y "$defaultdir/$matchedfolder" "$destinationdir");

    Perl makes this so much easier than doing the same thing in other languages, such as C or Java. SOOOO much easier with that qq operator.

      That was it. Thanks alot!