Using OSDT from tbs script (Resolved)

User discussion and information resource forum for scripting of TeraByte products using script lanugages such as TBScript, VBScript, Batch Files, and more.
Post Reply
nemesis
Posts: 76
Joined: Mon Jun 21, 2021 12:25 pm

Using OSDT from tbs script (Resolved)

Post by nemesis »

Update: It seems that my ignorance got the better of me so please take the original comment with a grain of salt! The rest of the thread explains clearly how to approach this. My error was making the assumption that in a script you'd use the syntax described in the "General Usage Notes" of the tbosdt manual. Which is incorrect!

For anyone running into similar issues. Please make sure you checked the following:
- https://www.terabyteunlimited.com/tbosdt.htm (there is a link at the bottom with an excellent example!)
- tbosdt.pdf beyond page 75!

I have not modified the original message for prostarities sake!
-----------------------------

So I have been banging my head against the wall and the manuals aren't really helpfull. They contain a lot of info but I cannot get some simple things to work.

The first script I'll be creating will automatically restore a tbi file to a disk. I have the command to do it using imagew.exe and have a simple tbs script which works with hard coded values.

Now hardcoded is not an option for obvious reasons. I need something a bit more dynamic. Thus I need to retreive the HD ID's and partion GUID's. My idea was to use tbosdt for this. However I cannot get this to work!

In interactive mode I can get it to show me the partitions on HD 0. Not to difficult "list hd 0". Great so now I want to call this from a tbs script and store the result so I can use it.

I've tried numerous aproaches however cannot get this to work. Can anyone give me a simple example of how to do this?

I've tried:
- Starting a tbs script from the command line in Windows 10 and TBPE with
-> a = list hd 0;
-> a = RUN list hd 0;
-> a = RUN list hd 0;
- Running a script using tbosdt from win 10:
-> "C:\Program Files (x86)\TeraByte Drive Image Backup and Restore Suite\TeraByte OSD Tool Suite Pro\win\tbosdtw64.exe" "C:\Program Files (x86)\TeraByte Drive Image Backup and Restore Suite\TeraByte OSD Tool Suite Pro\win\test.tbs" (contents: list hd 0)
-> "C:\Program Files (x86)\TeraByte Drive Image Backup and Restore Suite\TeraByte OSD Tool Suite Pro\win\tbosdtw64.exe" "C:\Program Files (x86)\TeraByte Drive Image Backup and Restore Suite\TeraByte OSD Tool Suite Pro\win\test.run" (contents: list hd 0)

As a side note I was extremely sagrined to find out that after buying a license I could not find any example scripts and the scripts that are provided are not readable.
Last edited by nemesis on Thu Jul 22, 2021 1:52 pm, edited 5 times in total.
TeraByte Support
Posts: 3596
Joined: Thu May 05, 2011 10:37 pm

Re: Using OSDT from tbs script

Post by TeraByte Support »

Have you seen the sample.tbs at https://www.terabyteunlimited.com/tbosdt.htm ?

Also, ensure you review the TBScript manual in additional to the extend commands in the TBOSDT Manual.

If you're using a .run file the interactive commands are the same. If tbs, you would use the "ext" subroutine to launch it. But you're probably looking for the "GetHDInfo" which is in the TBOSDT manual.
TeraByte Support(PP)
Posts: 1643
Joined: Fri Aug 12, 2011 12:51 am

Re: Using OSDT from tbs script

Post by TeraByte Support(PP) »

There is an example in the tbosdt.pdf manual (page 78) using the GETHDINFO() function. You would loop drives and save what you needed.

For example, to list drives and partitions create a script (e.g. listdrvs.tbs) and then run from TBOSDT using: run listdrvs.tbs
(I don't list GUID values here, but they're in the manual example.)

sub main()
getdrvltrinfo()
n=0
h=gethdinfo(n)
while h
printl("HDNum:", h.num)
printl(" Partitions:")
pn=1
while h.partition[pn]
dl = " "
if len(h.partition[pn].drvltr) > 0 then
dl = h.partition[pn].drvltr # ":"
end if
printl(" #", pn, " id: 0x", hex(h.partition[pn].id), " (", dl, ")", " name: ", h.partition[pn].name)
pn=pn+1
wend
printl("")
n=n+1
h=gethdinfo(n)
wend
getdrvltrinfo(0)
end sub
TeraByte Support
Posts: 3596
Joined: Thu May 05, 2011 10:37 pm

Re: Using OSDT from tbs script

Post by TeraByte Support »

Code: Select all

sub main()
  getdrvltrinfo()
  n=0
  h=gethdinfo(n)
  while h
    printl("HDNum:", h.num)
    printl("  Partitions:")
    pn=1
    while h.partition[pn]
      dl = "  "
      if len(h.partition[pn].drvltr) > 0 then
        dl = h.partition[pn].drvltr # ":"
      end if
      printl("   #", pn, " id: 0x", hex(h.partition[pn].id), " (", dl, ")", " name: ", h.partition[pn].name)
      pn=pn+1
    wend
    printl("")
    n=n+1
    h=gethdinfo(n)
  wend
getdrvltrinfo(0)
end sub
nemesis
Posts: 76
Joined: Mon Jun 21, 2021 12:25 pm

Re: Using OSDT from tbs script

Post by nemesis »

Hi Guys, Gals and anything in between,

to start off my apologies for wasting your time! For some reason I made a number of incorrect assumptions going in and got stuck in these!

I have looked into TBScript which is basicly just VB. Made a few sripts using it and that did work as expected.

The issue arrised with the need to be able to do more and thus use TBOSDT. I read the beginning of the TBOSDT manual and assumed that the syntax would be the same when used in tbs.

On the .run script I tried this and that does not seem to work though, which is irrelevant since I do not need it:

Code: Select all

list hd 0
@tbsupport did not find that sample thnx. Also since I didn't bother to venture further into the document due to my own stupidity I did not find the examples in it!
nemesis
Posts: 76
Joined: Mon Jun 21, 2021 12:25 pm

Re: Using OSDT from tbs script

Post by nemesis »

Ok, so I have looked at the scripts provided and the sample script. Those are all awesome and I'm making good headway!

Thank you for all your help. Even though my initial post was less then ideal, to put it lightly!
Post Reply