Customise "Backup Drive with TeraByte Image for Windows"

User discussion and information resource forum for Image products.

Customise "Backup Drive with TeraByte Image for Windows"

Postby Mikka » Sun Aug 21, 2016 4:12 am

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
Mikka
 
Posts: 12
Joined: Sun Aug 21, 2016 3:37 am

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

Postby TeraByte Support » Sun Aug 21, 2016 12:39 pm

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
TeraByte Support
 
Posts: 2275
Joined: Thu May 05, 2011 3:37 pm

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

Postby Mikka » Thu Aug 25, 2016 8:20 am

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]?
Mikka
 
Posts: 12
Joined: Sun Aug 21, 2016 3:37 am

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

Postby TeraByte Support » Thu Aug 25, 2016 5:47 pm

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]?

TeraByte Support
 
Posts: 2275
Joined: Thu May 05, 2011 3:37 pm

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

Postby Mikka » Sat Aug 27, 2016 4:46 am

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.
Mikka
 
Posts: 12
Joined: Sun Aug 21, 2016 3:37 am

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

Postby TeraByte Support » Sat Aug 27, 2016 10:28 am

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.

TeraByte Support
 
Posts: 2275
Joined: Thu May 05, 2011 3:37 pm

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

Postby Mikka » Sun Aug 28, 2016 6:05 am

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!
Mikka
 
Posts: 12
Joined: Sun Aug 21, 2016 3:37 am

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

Postby TAC109 » Sun Aug 28, 2016 1:43 pm

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.
TAC109
 
Posts: 214
Joined: Tue Sep 06, 2011 3:41 pm

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

Postby Mikka » Thu Sep 01, 2016 4:41 am

Hm. Okay, I'll keep it for the moment. However, a delimiter could improve readability:
Maybe a comma or an apostrophe would be better?
Mikka
 
Posts: 12
Joined: Sun Aug 21, 2016 3:37 am

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

Postby Mikka » Wed Sep 07, 2016 4:15 am

Any idea how I can structure $~HHMM$ with an apostrophe as in: 15'02 ?
Mikka
 
Posts: 12
Joined: Sun Aug 21, 2016 3:37 am


Return to Image for DOS/Linux/Windows

cron