Page 1 of 1

xcopy cmd in CE

Posted: Wed Oct 26, 2022 5:00 pm
by S1N74X
Not sure if this fits here, but something what I have put together.
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