Page 1 of 1

Customise "Backup Drive with TeraByte Image for Windows"

Posted: Sun Aug 21, 2016 11:12 am
by Mikka
Hi,

IfW offers the option to create a partition image with a single click, using a preset compression level and image file name.
The name pattern is stored in the Registry in the key
[HKCR\Drive\shell\Backup Drive with TeraByte Image for Windows\command]
and points to the file contextbackup.cmd. The relevant part of the registry value reads:
Drive $DL$ - $~YYYY$-$~MM$-$~DD$ @ $~HHMM$
That means, a .tbi named Drive C - 2016-08-21 @ 1240 will be created.

I'm looking for this: C system @Computer001 - 2016-08-21 @ 1240
i.e. {Drive letter} {Partition label*} @{Computer name} - {Date @ Time}

How can this be done?
Best regards.
__
* if existing

Re: Customise "Backup Drive with TeraByte Image for Windows"

Posted: Sun Aug 21, 2016 7:39 pm
by TeraByte Support
So %DL% is handle by the batch file. You could use tbscript to do
everything or could use tbosdt to help batch file. Say your volume label is
what you want ..

echo list vol %Drive%: > %temp%\getvollab.run
"C:\Program Files (x86)\TeraByte Drive Image Backup and Restore
Suite\TeraByte OSD Tool Suite Pro\win\tbosdtw" %temp%\getvollabl.run >
%temp%\myvollab.txt
set /P thevollab=<%temp%\myvollabl.txt

.... Now your %thevollab% has the volume label.

hostname > %temp%\hostname.txt
set /P myhost=<%temp%\hostname.txt

now %myhost% has the machine name.

"Mikka" wrote in message news:12229@public.image...

Hi,

IfW offers the option to create a partition image with a single click, using
a preset compression level and image file name.
The name pattern is stored in the Registry in the key
[HKCR\Drive\shell\Backup Drive with TeraByte Image for Windows\command]
and points to the file contextbackup.cmd. The relevant part of the registry
value reads:
Drive $DL$ - $~YYYY$-$~MM$-$~DD$ @ $~HHMM$
That means, a .tbi named Drive C - 2016-08-21 @ 1240 will be created.

I'm looking for this: C system @Computer001 - 2016-08-21 @ 1240
i.e. {Drive letter} {Partition label*} @{Computer name} - {Date @ Time}

How can this be done?
Best regards.
__
* if existing

Re: Customise "Backup Drive with TeraByte Image for Windows"

Posted: Thu Aug 25, 2016 3:20 pm
by Mikka
I have not used tbscript yet, but did find a solution for both {Partition label} and {Computer name} in pure batch:

:: Computer name
For /f "tokens=2 delims='='" %%? In ('wmic OS Get CSName /value') Do (Set Hostname=%%?)

:: Volume/partition label, ensuring that whitespace within the label is replaced and the leading character is one blank
For /f "usebackq tokens=2 delims==" %%# In (`wmic LogicalDisk where "DeviceID='%Drive%:'" Get VolumeName /format:value`) Do (Set DriveLabel=%%#)
If Defined DriveLabel (
Set DriveLabel=%DriveLabel: =_%
Set DriveLabel= %DriveLabel%
)

I'm not supposed to tamper with :RunIFW, right?

What is your suggestion to get the two additional parameters in the file naming scheme?
Shall I extend the IFWParms variable?
Or is it necessary to alter the value under [HKCR\Drive\shell\Backup Drive with TeraByte Image for Windows\command]?

Re: Customise "Backup Drive with TeraByte Image for Windows"

Posted: Fri Aug 26, 2016 12:47 am
by TeraByte Support
see the prior post which showed you how to do it and put them in variables,
then just use those variables when building the file name in the .cmd file
(as it does now, just add your new ones).


"Mikka" wrote in message news:12322@public.image...

I have not used tbscript yet, but did find a solution for both {Partition
label} and {Computer name} in pure batch:

:: Computer name
For /f "tokens=2 delims='='" %%? In ('wmic OS Get CSName /value') Do (Set
Hostname=%%?)

:: Volume/partition label, ensuring that whitespace within the label is
replaced and the leading character is one blank
For /f "usebackq tokens=2 delims==" %%# In (`wmic LogicalDisk where
"DeviceID='%Drive%:'" Get VolumeName /format:value`) Do (Set DriveLabel=%%#)
If Defined DriveLabel (
Set DriveLabel=%DriveLabel: =_%
Set DriveLabel= %DriveLabel%
)

I'm not supposed to tamper with :RunIFW, right?

What is your suggestion to get the two additional parameters in the file
naming scheme?
Shall I extend the IFWParms variable?
Or is it necessary to alter the value under [HKCR\Drive\shell\Backup Drive
with TeraByte Image for Windows\command]?


Re: Customise "Backup Drive with TeraByte Image for Windows"

Posted: Sat Aug 27, 2016 11:46 am
by Mikka
I got the two variables already and they work like a charm.

It's passing them on what doesn't work yet. And I'm wondering where I've got to make changes:
1) Registry value (command)
2) Parameter logic of contextbackup.cmd itself (e.g. for Set IFWParms)
3) Both of them

The relevant line of contextbackup.cmd is
start "" %IFWPath% /b /d:?%Drive% %IFWParms%
and it's just the drive letter which is accepted as parameter.

The Registry value holds the timestamp part, the file naming happens there.
So instead of ..\Drive $DL$ - $~YYYY$-$~MM$-$~DD$ @ $~HHMM$" %1 it should be like
..\$DL$ %DriveLabel% @%Hostname% - $~YYYY$-$~MM$-$~DD$ @ $~HHMM$" %1
but both new variables need to be made public via handles, is that correct?

For the time being, I'd like to do without tbscript if possible.

Re: Customise "Backup Drive with TeraByte Image for Windows"

Posted: Sat Aug 27, 2016 5:28 pm
by TeraByte Support
The information given before was not TBScript, it was a batch file.

Right, if you change it to include say $MYCUSTOM$ then in the batch file
after it changes the $DL% to the %drive%

You could do the same:
set IFWParams=~IFWParams:$MYCUSTOM$=%drivelabel%@%hostname%-~


You just add the variable to the filename.

start "" %IFWPath% /b /d:?%Drive% %IFWParms%

"Mikka" wrote in message news:12353@public.image...

I got the two variables already and they work like a charm.

It's passing them on what doesn't work yet. And I'm wondering where I've got
to make changes:
1) Registry value (command)
2) Parameter logic of contextbackup.cmd itself (e.g. for Set IFWParms)
3) Both of them

The relevant line of contextbackup.cmd is
start "" %IFWPath% /b /d:?%Drive% %IFWParms%
and it's just the drive letter which is accepted as parameter.

The Registry value holds the timestamp part, the file naming happens there.
So instead of ..\Drive $DL$ - $~YYYY$-$~MM$-$~DD$ @ $~HHMM$" %1 it should be
like
...\$DL$ %DriveLabel% @%Hostname% - $~YYYY$-$~MM$-$~DD$ @ $~HHMM$" %1
but both new variables need to be made public via handles, is that correct?

For the time being, I'd like to do without tbscript if possible.


Re: Customise "Backup Drive with TeraByte Image for Windows"

Posted: Sun Aug 28, 2016 1:05 pm
by Mikka
First off, it's functional now, thanks alot! :D
That comes in quite handy as now I can make full use of the context menu option.

A last detail concerns the timestamp pattern $~YYYY$-$~MM$-$~DD$ @ $~HHMM$
It will output the current time as 2016-08-28 @ 1502 - which is correct - however
2016-08-28 @ 15.02
would be better.

$~HH gives me the two digit hour number. $~MM gives me the two digit month number,
what are the minutes (incl. leading zero)?

Thank you very much for your support!

Re: Customise "Backup Drive with TeraByte Image for Windows"

Posted: Sun Aug 28, 2016 8:43 pm
by TAC109
Introducing an extra dot into the image file name is not a good idea. I've had problems with this in the past with issues such as mis-named hash files, and restores not automatically being able to follow the chain of image files back to the linked Incrementals and Full backups.

Re: Customise "Backup Drive with TeraByte Image for Windows"

Posted: Thu Sep 01, 2016 11:41 am
by Mikka
Hm. Okay, I'll keep it for the moment. However, a delimiter could improve readability:
Maybe a comma or an apostrophe would be better?

Re: Customise "Backup Drive with TeraByte Image for Windows"

Posted: Wed Sep 07, 2016 11:15 am
by Mikka
Any idea how I can structure $~HHMM$ with an apostrophe as in: 15'02 ?