Maybe its useful for someone
Example uses Windows "xcopy" command to copy files from C:\ with the extension *.lfm to E:\temp
Also creates an Folder on Destination E:\
The function run_cmd can be applied to other os calls as well.
Spoiler
Code: Select all
local function run_cmd(cmd, param_string)
local command_str = string.format("%s %s", cmd, param_string or "")
print(command_str)
local result = os.execute(command_str)
return result
end
local function xcopy(source, fileExtension, destination)
local cmd = 'xcopy.exe'
local res = '"'..source .. '"' .. fileExtension .. ' "'..destination..'" /S /C /Y'
run_cmd(cmd,res)
end
xcopy('C:\\Users\\Downloads\\cheat-engine-master\\cheat-engine-master\\Cheat Engine\\','*.lfm','E:\\temp\\') -- example