Overwriting Win system files under BIBM TBOSDT

User discussion and information resource forum for scripting of TeraByte products using script lanugages such as TBScript, VBScript, Batch Files, and more.
Post Reply
schmibble
Posts: 22
Joined: Sat Aug 25, 2012 4:45 am

Overwriting Win system files under BIBM TBOSDT

Post by schmibble »

Really, two questions here.

1
=
I need to overwrite Windows system files as part of a registry restoration script to be run in TBOSDT. To do this, I'm assuming that I'll need to turn off read-only, system, and hidden in order to overwrite. Unfortunately, the code in tbexplo.tbs only deals with turning an attribute on, as far as I can tell, so the example there doesn't seem to apply. I just need to toggle the attributes off the way the DOS attrib command does, like this:

ATTRIB -r -s -h c:\windows\system32\SAM

If I'm correctly reading this code from setwindl.tbs...

"SetAttr(filepath, 0)"

...then passing in 0 as the second parameter of SETATTR() the command "SetAttr(filepath, 0)" will do what I need (indeed, more than I need) by removing all file attributes. I'd just like to get verification that my interpretation is correct.


2
=
I'm going to run my script on a BIBM boot floppy, outside Windows. So maybe I don't need to worry about the overwriting issue--do the standard attribute bits still apply under TBOSDT? I assume TBOSDT does observe FAT file attributes, especially since runs in Protected mode, but again, is that true? Because if not, then I don't need to worry about turning attributes off after all.
Eric
Posts: 224
Joined: Mon Sep 05, 2011 6:53 pm
Location: France

Re: Overwriting Win system files under BIBM TBOSDT

Post by Eric »

schmibble wrote:
> 1
> ...then passing in 0 as the second parameter of SETATTR() the command
> "SetAttr(filepath, 0)" will do what I need (indeed, more than I
> need) by removing all file attributes. I'd just like to get verification
> that my interpretation is correct.

Yes. Passing 0 to SetAttr() will remove all the file attributes.

> 2
> I'm going to run my script on a BIBM boot floppy, outside Windows. So maybe
> I don't need to worry about the overwriting issue--do the standard
> attribute bits still apply under TBOSDT? I assume TBOSDT does observe FAT
> file attributes, especially since runs in Protected mode, but again, is
> that true? Because if not, then I don't need to worry about turning
> attributes off after all.

If you overwrite a file using the copy command of TBOSDT with the /y switch (while accessing the target partition using 0: or not), then you don't need to take care of the file attributes of the file being erased.
schmibble
Posts: 22
Joined: Sat Aug 25, 2012 4:45 am

Re: Overwriting Win system files under BIBM TBOSDT

Post by schmibble »

Excellent! Thanks very much.
Post Reply