What is the command to copy a file from one directory to another?for example, to open files we use 'OLE FILEACTION 'open'.
is it possible to copy via OLE command?
STRING sourceFilepath = "C:\Users\powermill\Documents\cube.dmt"
STRING targetFilepath = "C:\Users\powermill\Documents\cube2.dmt"
STRING batFilePath = "C:\Users\powermill\Documents\copy.bat"
FILE OPEN $batFilePath FOR WRITE AS output
STRING textLine1 = "@echo off"
STRING textLine2 = "set source=" + $sourceFilepath
STRING textLine3 = "set destination=" + $targetFilepath
STRING textLine4 = ""
STRING textLine5 = 'copy "%source%" "%destination%"'
FILE WRITE $textLine1 TO output
FILE WRITE $textLine2 TO output
FILE WRITE $textLine3 TO output
FILE WRITE $textLine4 TO output
FILE WRITE $textLine5 TO output
FILE CLOSE output
OLE FILEACTION 'open' $batFilePath
Hi @ondrej.mikulec,
Your macro is working nice for a file!
But I would ask how can we copy and past a folder to another directory.
The macro simply involves creating and executing a batch file, which means you can accomplish most tasks that a batch file can handle. To determine the specific commands to include in the batch file, I suggest seeking assistance for example from ChatGPT.
Can't find what you're looking for? Ask the community or share your knowledge.