xcopy cmd in CE

Want Cheat Engine to do something specific and no idea how to do that, ask here. (From simple scripts to full trainers and extensions)
Post Reply
S1N74X
Cheater
Cheater
Posts: 40
Joined: Wed Sep 15, 2021 4:25 pm
Reputation: 4

xcopy cmd in CE

Post 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


Post Reply

Who is online

Users browsing this forum: No registered users