Jump to content
Sign in to follow this  
DeFuser

File Encoding?

Recommended Posts

DeFuser

Hello All,

I'm putting together a routine that runs NTBackup.exe from the command line. Part of this entails creating a .bks file (which tells NTBackup *what* to backup) on the fly. The problem is that (and it took a while to track this down) .bks files created via the NTBackup GUI look like this when viewed in a hex editor: S.y.s.t.e.m.S.t.a.t.e.

I've tried opening and writing to the file using different encodings, but haven't been met with much love - Little Endian add gibberish to the beginning of the file, and Unicode doesn't add the "00" bytes. What is the best way to address this? Is there an encoding setting that I am missing or should I go about inserting the "00" bytes manually?

I've attached an image of the file as seen in the editor.

Thanks,

DeF

post-10263-1231453026_thumb.gif

Share this post


Link to post
Share on other sites
DeFuser

Sorry, perhaps I should have been more specific. The utility reads settings from an central .ini and kicks-off the backup locally, and without user intervention.

For example, if the .ini says that machine X needs backups of C:, D:, and the System State, the utility builds the .bks file and then fires-off NTBackup, telling it to use said .bks file.

I'm thinking of creating the .bks file using Little Endian and then stripping off the first two bytes, but I am unsure as to whether a) this will work, or b ) that it's the best approach.

I'm not the fastest at making this stuff (it's usually some trial and lots of error), but the .bks files are 2 or 3 lines at most so I figure that it can't be that difficult of a thing to do manually, right?

Thanks,

DeF

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×