Announcement

Collapse
No announcement yet.

Copy folder to AppData \ Roaming universally

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Copy folder to AppData \ Roaming universally

    I would like to know how I do to copy a folder to AppData \ Roaming in a universal way so that it runs on any pc.

    Sorry for my lack of knowledge!

  • #2
    Hi, for this you can use the:
    Shell Get Folder

    Comment


    • #3
      Can you give me an example?

      Comment


      • #4
        I want to copy a folder to AppData \ Roaming

        Comment


        • #5
          Here is a sample script:

          Code:
          -- retrieve the default application data folder
          local sApplicationDataFolder = Shell.GetFolder(SHF_APPLICATIONDATA);
          -- set default target folder
          local sMyDataFolder = sApplicationDataFolder .. "\\MyApplicationName";
          
          -- if needed, create the target folder for the application
          if (not Folder.DoesExist(sMyDataFolder)) then
          Folder.Create(sMyDataFolder);
          error = Application.GetLastError();
          if (error ~= 0) then
          Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
          -- can't copy files if folder could not be created
          Application.ExitScript();
          end
          end
          
          -- copy all files in the "MyFiles" folder of the AutoPlay application
          StatusDlg.Show();
          File.Copy("AutoPlay\\MyFiles\\*.*", sMyDataFolder, true, true, false, false)
          StatusDlg.Hide();

          Comment


          • #6
            Thank you very much my savior!

            Comment

            Working...
            X