Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 2 of 2

Thread: Move a Folder

  1. #1
    Join Date
    Jan 2007
    Posts
    49

    Move a Folder

    Does anyone know if it is possible to Move a Folder and all its contents in AMS5, or do you have to copy it first, then delete it?

  2. #2
    Join Date
    Oct 2007
    Location
    Gensokyo
    Posts
    1,324
    Code:
    File.Move("C:\\Folder\\*", "C:\\Destination\\");
    ?

  3. #3
    Join Date
    Jan 2007
    Posts
    49

    Re: Move a Folder

    Thanks for a quick response ShadowUK
    I wondered if File.Move would do folders as well, however I can't seem to get the following code to work. Any Ideas?

    FindFldr = Folder.Find(_DesktopFolder, "*", false, nil);
    for index,fldrs in FindFldr do
    Folder.Create("C:\\NewFolder");
    StatusDlg.Show();
    File.Move(fldrs, "C:\\NewFolder\\", true, true, false, true, nil);
    StatusDlg.Hide();
    if (error ~= 0) then
    Dialog.Message("Error", tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
    else
    Dialog.Message("Success", "Moving ALL files from your Desktop was successful", MB_OK, MB_ICONINFORMATION);
    end
    end
    end

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts