Page 1 of 1
Copy folders
Posted: Sat Oct 11, 2014 5:02 pm
by pcrolin
More and more working with the UVK tool. Just realy a great tool!
I tried to figure out how to copy a folder within several subfolders and files from my usb stick to my C: partition.
For example i tried:
<ReplaceFile>
%InstallSourceDir%\Sys_recovery\*.* | c:\sys_recovery\
and i tried
<cmd script>
xcopy %InstallSourceDir%\Sys_recovery\ c:\sys_recovery\ /s/e/i/f/h/y
This doesn't do the trick.
Is there a way to copy folders?
Re: Copy folders
Posted: Sat Oct 11, 2014 5:44 pm
by Fred
Hi pcrolin.
You have many ways to copy directories. One of them is by using the xcopy command, like you did, except there are some syntax errors.
Code: Select all
<CmdScript>
xcopy "%InstallSourceDir%\Sys_recovery" "C:\sys_recovery" /s /y /e /q /h /i
Note: <CmdScript> has no whitespace, Both source and destination paths are enclosed in double quotes (good practice), and there is a white space between the last switches (/s /y /e /q /h /i).
You have a better way to copy directories: Using <AutoItScript> instead:
Code: Select all
<AutoItScript>
$sourcedir = EnvGet('InstallSourceDir')&'\Sys_recovery'
DirCopy($sourcedir,'C:\sys_recovery',1)
Exit @error
I like this one better, but you can use the one you want. For both scripts, the exit code being 0 means success. Any other value means an error occurred.
Re: Copy folders
Posted: Sat Oct 11, 2014 11:01 pm
by pcrolin
Hi Fred ,
you're my hero!
I have just modified and tested with xcopy . It works perfectly . Many thanks for your quick response .
I still can not work with < AutoItScript > because I know from too little . What language is that ? I want to learn myself more about it .
Cheers Roel
Re: Copy folders
Posted: Sun Oct 12, 2014 9:24 am
by Fred
Hi pcrolin.
AutoIt is the language in which UVK was initially created. It is an advanced scripting language, that allows you to create real applications with windows and controls. It also allows you to access and create most COM/ActiveX objects, including WMI. It has a large comunity forum and is quite well known among the IT industry.
https://www.autoitscript.com/site/autoit/
Re: Copy folders
Posted: Sun Oct 12, 2014 3:08 pm
by pcrolin
Thx for the info Fred.