Use RoboCopy cmd/bat fiiles from within TI Pre/Post command task options
Use RoboCopy cmd/bat files from within TI Pre/Post command task options
Most any of the RobCopy functions possible.
This example uses TI post command option to use Robocopy to copy Backups from one folder to another folder as duplicates, from within a "cmd" file.
------------------------------------------
1. MUST Open Notepad IN "Run as Administrator" mode.
START/All Programs/Accessories/
RIGHT CLICK on NOTEPAD and Select "Run as Administrator"
Paste text below into the elevated NotePad
Save pasted text with "cmd" extension such as
c:\pstools\new-robo-test.cmd
paste into elevated Notepad wrote:@ECHO OFF
%SystemDrive%
cd\Windows\system32\
:: FYI-To copy source folder into target folder with Manual cleanup of target
:: FYI- or Add /MIR to command for target to mirror source.
::
RoboCopy D:\TEST-2-SOURCE D:\TEST-2-TARGET
@EXIT
Section 1:
Notepad must be opened via the elevated prompt before inputing data into Notepad.
Simple copy of one folder to another folder. Both contents the same.
Section 2:
Task Options/Advanced/ Pre/Post Command options
Don't type path. Use Browse function to enter path to cmd file.
Section 3:
Comparison of Source Folder to Target Folder. Target folder content copied from Source by RoboCopy.
Section 4:
email notification of a similar test--not same test as above.
1 Information 2/16/2015 11:09:54 AM Backup reserve copy attributes: format tib; need_reserve_backup_copy false;
2 Information 2/16/2015 11:09:54 AM Operation (1)Test-lexar-Feb14-1 started manually.
3 Information 2/16/2015 11:09:54 AM Operation description: Stage Description.
4 2/16/2015 11:09:54 AM AcronisLRPCConnect::BEGIN id=4,336
5 2/16/2015 11:09:54 AM AcronisLRPCConnect::BEGIN id=3,688
6 2/16/2015 11:09:54 AM Retreiving Fdisk ver1 disk set to Fdisk ver2c disk set...
7 2/16/2015 11:09:54 AM Fdisk2: Use Disk 1 host= 0 bus = 0 target = 0
8 2/16/2015 11:09:54 AM Fdisk2: Use Disk 2 host= 0 bus = 0 target = 0
9 2/16/2015 11:09:54 AM Refreshing Drivers...
10 2/16/2015 11:09:54 AM Enter to process disks in Mbr Driver (id = 9)
11 2/16/2015 11:09:54 AM Exit from process disks in Mbr Driver (id = 9)
12 2/16/2015 11:09:54 AM Enter to process disks in Gpt Driver (id = 10)
13 2/16/2015 11:09:54 AM Exit from process disks in Gpt Driver (id = 10)
14 2/16/2015 11:09:54 AM LDM: New ProcessDisks(rawLayer, headLayer)
15 2/16/2015 11:09:54 AM ProcessDisks: One more disk to check
16 2/16/2015 11:09:54 AM ProcessDisks: One more disk to check
17 2/16/2015 11:09:54 AM Mark All groups as Root Like Dgs
18 2/16/2015 11:09:54 AM ------ Volumes Objects ------
19 2/16/2015 11:09:54 AM LDM initialization complete
20 2/16/2015 11:09:54 AM Analyzing partition '0-0'...
21 2/16/2015 11:09:54 AM AcronisLRPCConnect::BEGIN id=5,376
22 2/16/2015 11:09:55 AM Analyzing partition '1-1'...
23 2/16/2015 11:09:55 AM Analyzing partition 'C:'...
24 2/16/2015 11:09:55 AM Analyzing partition '0-0'...
25 2/16/2015 11:09:55 AM Analyzing partition 'D:'...
26 Information 2/16/2015 11:09:55 AM Backup reserve copy attributes: format tib; need_reserve_backup_copy false;
27 2/16/2015 11:09:55 AM Error while opening configuration file .
28 2/16/2015 11:09:55 AM Error occurred while creating the file.
29 Information 2/16/2015 11:09:55 AM Operation: backup
30 Information 2/16/2015 11:09:55 AM Priority changed to Low.
31 2/16/2015 11:10:18 AM Locking partition C:...
32 Information 2/16/2015 11:10:30 AM Create Backup Archive From: C:\Users\Grover\My Documents\MyTextFiles\
To file: "(1)Test-lexar-Feb14-1_full_b2_s1_v1.tib" Compression: Normal Exclude: Files matching mask Match criterion: $Recycle.Bin, swapfile.sys, System Volume Information, *.tib, *.tib.metadata, *.~, *.tmp, C:\Users\Grover\AppData\Local\Temp, C:\Users\Compaq User\AppData\Local\Temp, C:\Users\Grover\AppData\Local\Microsoft\Windows\Temporary Internet Files, C:\Users\Compaq User\AppData\Local\Microsoft\Windows\Temporary Internet Files, C:\Users\Grover\AppData\Local\Google\Chrome\User Data, C:\Users\Grover\AppData\Local\Opera Software, C:\Users\Grover\AppData\Roaming\Opera\Opera, C:\Users\Grover\AppData\Local\Mozilla\Firefox\Profiles, C:\Users\Compaq User\AppData\Local\Google\Chrome\User Data, C:\Users\Compaq User\AppData\Local\Opera Software, C:\Users\Compaq User\AppData\Roaming\Opera\Opera
33 Warning 2/16/2015 11:10:31 AM Link target was not backed up.
34 Information 2/16/2015 11:10:31 AM Writing full version to file: (1)Test-lexar-Feb14-1_full_b2_s1_v1.tib
35 Information 2/16/2015 11:10:31 AM The following backups have been successfully created: "D:\test2-source\(1)Test-lexar-Feb14-1_full_b2_s1_v1.tib"
36 Information 2/16/2015 11:10:34 AM Consolidate Backup Archive Location: "D:\test2-source\(1)Test-lexar-Feb14-1_full_b2_s1_v1.tib" Destination: "D:\test2-source\(1)Test-lexar-Feb14-1_full_b2_s1_v1_DB8D88B7-EF16-4B62-A955-459BFF16DC28.tib"
37 Information 2/16/2015 11:10:34 AM Consolidate Backup Archive Location: "D:\test2-source\(1)Test-lexar-Feb14-1_full_b2_s1_v1.tib" Destination: "D:\test2-source\(1)Test-lexar-Feb14-1_full_b2_s1_v1_DB8D88B7-EF16-4B62-A955-459BFF16DC28.tib"
38 Information 2/16/2015 11:10:34 AM Deleting backup file with path D:\test2-source\(1)Test-lexar-Feb14-1_inc_b1_s2_v1.tib.
39 Information 2/16/2015 11:10:34 AM Deleting backup file with path D:\test2-source\(1)Test-lexar-Feb14-1_full_b1_s1_v1.tib.
40 True Image 2/16/2015 11:10:35 AM Child process has exited with code '1'.
41 Information 2/16/2015 11:10:35 AM Execution of user command succeeded: C:/PSTools/new2-robo-test.cmd
42 2/16/2015 11:10:35 AM ServerLRPC::_CloseConnection id=5,376
43 2/16/2015 11:10:35 AM ServerLRPC::_CloseConnection id=5,376
44 2/16/2015 11:10:35 AM ServerLRPC::_CloseConnection id=3,688
45 2/16/2015 11:10:35 AM ServerLRPC::_CloseConnection id=3,688
46 2/16/2015 11:10:35 AM ServerLRPC::_CloseConnection id=4,336
47 2/16/2015 11:10:35 AM ServerLRPC::_CloseConnection id=4,336
48 Information 2/16/2015 11:10:35 AM Operation has succeeded.
By adding other Robocopy commands to the command line of the bat/cmd file,
other file actions can be accomplished.
Attachment | Size |
---|---|
robo-1.jpg | 9.25 KB |
robo-2.jpg | 26.49 KB |
robo-3.jpg | 54.15 KB |

- Log in to post comments

mgrobins,
It is a copy process only and will do nothing about managing anything.
- Log in to post comments

Thanks :). I think my query may be a bit OT given what I've worked out from your posting (sorry :)).
I thought Robocopy could be used to effectively sync two directories (but was initialy uncertain if it can "clean up" the target directory). As I understand it the /MIR option achieve this?
http://improve.dk/simple-file-synchronization-using-robocopy/
http://windowsitpro.com/windows-server/robocopy-over-network
These helped me develop a reliable way to ensure copies proceed but I don't see a way to have Robocopy open a network connection (eg login /password) for the destination. Is that possible or would it require something like the "net" command to open the connection and close it after?
- Log in to post comments

As far as I can tell, Robocopy has not built in authentication options. Netuse seems to be the best option.
https://klyavlin.wordpress.com/2012/09/19/robocopy-network-usernamepass…
Alternatively, pstools (psexec) may work for you as well. It can be scripted to connect to remote shares, but unfortunately, username and password are plaintext, but if your network is secure, should probably be OK.
https://technet.microsoft.com/en-us/sysinternals/pstools.aspx
- Log in to post comments

Hi mgrobins
In fact robocopy has some very useful features besides the simple copy example posted here. To sync the source and destination dirs you use the /MIR parameter. I use rc with /MIR to keep a copy of the ati files on a NAS.
The reserve copy feature is a bandwidth hog, as it transfers a full copy each time. I have found robocopy to have a light touch with regards to cpu and ram.
Thanks for the very useful original post, groverh.
- Log in to post comments