Jump to content

xcopy %~dp0

Go to solution Solved by mr-es335,

Recommended Posts

Good day,

Is there anyway to replicate the .cmd script following in AutoIt?

:: -----------------------------------------------
:: Create all directories and copy all data...
xcopy %~dp0Source_Data_C C:\ /e /s /h /q /r /y
xcopy %~dp0Source_Data_E E:\ /e /s /h /q /r /y
xcopy %~dp0Source_Data_F F:\ /e /s /h /q /r /y
xcopy %~dp0Source_Data_G G:\ /e /s /h /q /r /y
:: -----------------------------------------------
Sub-folders of C:\, Program Files, ProgramData, RML, Users, Windows
Sub-folders of E:\, Text
Sub-folders of F:\, Backing_Tracks
Sub-folders of G:\, AltPeakData, Automation_Data, CHT_Files, F-Key_Data, , Mix_Templates, Session_Master
The Sub-folders also contain folders and data

Thank yo for any assistance that may be provided!


Link to comment
Share on other sites

As @Andreik already mentioned, you can use your commands from inside AutoIT.


I would like to mention to use $ExitCode=RunWait() to start robocopy.exe instead of xcopy.exe:

The ExitCode of robocopy is giving you exact information, what was going on -- everything less than 8 is fine Robocopy Exit Codes from ss64.com

the /mir switch offers to sync the content to the destination folder (orphaned files in destination are deleted)

the option "/z" offers to copy in restartable mode, usefull for very large files to continue in case of network problems.


Note: There is one version of robocopy (coming from robocopyGUI), that doesn't provide valid exit codes. Just avoid grabbing that one accidentally (about the times of WinVista, IIRC)




Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

  • 3 weeks later...
  • Solution

Good day,

Thanks for the follow-ups...appreciated...

Though the suggestions noted have been considered and some attempted, I have since decided to not go this route.

I will mark the posting as "resolved" - even though the posting is not really resolved.

PS: The whole purpose in employing AutoIt! is to move out of DOS completely.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...