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!
Sorry for my lack of knowledge!
-- 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