Hi, I'm not a coder by any means, but I'm slightly wet behind the ears.
What I'm looking to do is the following:

I am responsible for imaging several desktop and laptop computers in our
school district, and one of the mundane tasks I must do after each machine
has been imaged is to remove the 2 checkmarks under startup and recovery
options in windows xp (time to display list of operating systems and time to
display list of recovery options...) It get's to be a hassle to do this
every time I image a machine, and was hoping that this could be done via a
script. Unfortunately, I've not been able to find any info on how to do
this with either wmi or vbscript. I was able to find info on setting the
timeout, but I really need to be able to disable both of these options
alltogether.

So, any ideas, sample scripts, things to look for, etc???

Thanks,

Doug

Re: wmi or vbscript help by Ed

Ed
Fri Jul 20 19:21:41 CDT 2007

The first one is in boot.ini, and should therefore should be easily editable
through a drive mapping and file edit.

The second one is apparently stored in bootstat.dat in a binary format, not
easily edited. I don't know if there's a WMI property for that; it would
probably take me as long to find it as it would take you, and I'll bet that
both of us would end up at a dead end, sorry.
--
Ed Crowley
MVP - Exchange
"Protecting the world from PSTs and brick backups!"

<D> wrote in message news:OdmccwsyHHA.4184@TK2MSFTNGP06.phx.gbl...
> Hi, I'm not a coder by any means, but I'm slightly wet behind the ears.
> What I'm looking to do is the following:
>
> I am responsible for imaging several desktop and laptop computers in our
> school district, and one of the mundane tasks I must do after each machine
> has been imaged is to remove the 2 checkmarks under startup and recovery
> options in windows xp (time to display list of operating systems and time
> to display list of recovery options...) It get's to be a hassle to do
> this every time I image a machine, and was hoping that this could be done
> via a script. Unfortunately, I've not been able to find any info on how
> to do this with either wmi or vbscript. I was able to find info on
> setting the timeout, but I really need to be able to disable both of these
> options alltogether.
>
> So, any ideas, sample scripts, things to look for, etc???
>
> Thanks,
>
> Doug
>



Re: wmi or vbscript help by TDM

TDM
Tue Jul 24 07:40:19 CDT 2007


<D> wrote in message news:OdmccwsyHHA.4184@TK2MSFTNGP06.phx.gbl...
> Hi, I'm not a coder by any means, but I'm slightly wet behind the ears.
> What I'm looking to do is the following:
>
> I am responsible for imaging several desktop and laptop computers in our
> school district, and one of the mundane tasks I must do after each machine
> has been imaged is to remove the 2 checkmarks under startup and recovery
> options in windows xp (time to display list of operating systems and time
> to display list of recovery options...) It get's to be a hassle to do
> this every time I image a machine, and was hoping that this could be done
> via a script. Unfortunately, I've not been able to find any info on how
> to do this with either wmi or vbscript. I was able to find info on
> setting the timeout, but I really need to be able to disable both of these
> options alltogether.
>
> So, any ideas, sample scripts, things to look for, etc???
>
> Thanks,
>
> Doug

Doug,

You mention "image". I assume this to be a ghost image of some sort
that you build your machines from. This is kind of obvious so I am likely
wrong here but why not fix the settings and create a new image from that ?

TDM


Re: wmi or vbscript help by D>

D>
Tue Jul 24 08:09:21 CDT 2007

Yes, I am using ghost. Unfortunately, when you sysprep, one of the many
settings that sysprep restores to defaults is the boot configuration that I
need to disable. So I can disable it before sysprep until I'm blue in the
face, but once I sysprep the image, it's reset to it's default settings. I
know that I could manually edit the boot.ini file as was suggested, however,
this would only take care of the first option of show a list of operating
systems... while actually the most important one in this case is the
recovery options menu. We don't want our users to be confronted with that
screen. I was hoping to be able to run a script to disable both properties
after deploying the image. I'm sure there's got to be a way, but I just
can't seem to find it.

Thanks,

Doug
"TDM" <rpuffd@gmail.com> wrote in message
news:uk5SO$ezHHA.5376@TK2MSFTNGP03.phx.gbl...
>
> <D> wrote in message news:OdmccwsyHHA.4184@TK2MSFTNGP06.phx.gbl...
>> Hi, I'm not a coder by any means, but I'm slightly wet behind the ears.
>> What I'm looking to do is the following:
>>
>> I am responsible for imaging several desktop and laptop computers in our
>> school district, and one of the mundane tasks I must do after each
>> machine has been imaged is to remove the 2 checkmarks under startup and
>> recovery options in windows xp (time to display list of operating systems
>> and time to display list of recovery options...) It get's to be a hassle
>> to do this every time I image a machine, and was hoping that this could
>> be done via a script. Unfortunately, I've not been able to find any info
>> on how to do this with either wmi or vbscript. I was able to find info
>> on setting the timeout, but I really need to be able to disable both of
>> these options alltogether.
>>
>> So, any ideas, sample scripts, things to look for, etc???
>>
>> Thanks,
>>
>> Doug
>
> Doug,
>
> You mention "image". I assume this to be a ghost image of some sort
> that you build your machines from. This is kind of obvious so I am likely
> wrong here but why not fix the settings and create a new image from that ?
>
> TDM



Re: wmi or vbscript help by TDM

TDM
Tue Jul 24 17:53:33 CDT 2007


<D> wrote in message news:OHKAbPfzHHA.3448@TK2MSFTNGP03.phx.gbl...
> Yes, I am using ghost. Unfortunately, when you sysprep, one of the many
> settings that sysprep restores to defaults is the boot configuration that
> I need to disable. So I can disable it before sysprep until I'm blue in
> the face, but once I sysprep the image, it's reset to it's default
> settings. I know that I could manually edit the boot.ini file as was
> suggested, however, this would only take care of the first option of show
> a list of operating systems... while actually the most important one in
> this case is the recovery options menu. We don't want our users to be
> confronted with that screen. I was hoping to be able to run a script to
> disable both properties after deploying the image. I'm sure there's got
> to be a way, but I just can't seem to find it.
>
> Thanks,
>
> Doug

I see now, good old sysprep. Just to validate, the second setting you
wish to change is indeed in the bootstat.dat file. I used a binary editor
to change the file. The byte you want is byte 9(0 based). I wonder if
you could use ADODB.stream to edit a binary file in VBS to change the
value ?

TDM



Re: wmi or vbscript help by Paul

Paul
Tue Jul 24 20:41:19 CDT 2007


"TDM" <rpuffd@gmail.com> wrote in message
news:OMGd4VkzHHA.3564@TK2MSFTNGP04.phx.gbl...
>
> <D> wrote in message news:OHKAbPfzHHA.3448@TK2MSFTNGP03.phx.gbl...
>> Yes, I am using ghost. Unfortunately, when you sysprep, one of the many
>> settings that sysprep restores to defaults is the boot configuration that
>> I need to disable. So I can disable it before sysprep until I'm blue in
>> the face, but once I sysprep the image, it's reset to it's default
>> settings. I know that I could manually edit the boot.ini file as was
>> suggested, however, this would only take care of the first option of show
>> a list of operating systems... while actually the most important one in
>> this case is the recovery options menu. We don't want our users to be
>> confronted with that screen. I was hoping to be able to run a script to
>> disable both properties after deploying the image. I'm sure there's got
>> to be a way, but I just can't seem to find it.
>>
>> Thanks,
>>
>> Doug
>
> I see now, good old sysprep. Just to validate, the second setting you
> wish to change is indeed in the bootstat.dat file. I used a binary editor
> to change the file. The byte you want is byte 9(0 based). I wonder if
> you could use ADODB.stream to edit a binary file in VBS to change the
> value ?
>
> TDM

If the file is not too big (5 or 10 megabytes is probably not too big), then
the ADODB stream object can be used. There are a few non-obvious things you
have to do, outlined in VBScript I posted on
microsoft.public.scripting.vbscript newsgroup in February.
Groups.google for the string "how to update binary field types in ADO"

-Paul Randall



Re: wmi or vbscript help by TDM

TDM
Thu Jul 26 17:02:51 CDT 2007


"Paul Randall" <paulr901@cableone.net> wrote in message
news:%23d$2CzlzHHA.5476@TK2MSFTNGP03.phx.gbl...
>

> If the file is not too big (5 or 10 megabytes is probably not too big),
> then the ADODB stream object can be used. There are a few non-obvious
> things you have to do, outlined in VBScript I posted on
> microsoft.public.scripting.vbscript newsgroup in February.
> Groups.google for the string "how to update binary field types in ADO"
>
> -Paul Randall
>

Paul,

File is a meager 2K in size. I had some spare time so I took a wack
at trying to edit this file and I achieved some level of success, but not
an acceptable level.

Perhaps you can shed some light on editing binary data in vbs ? I found
very little useful info from google. What I did was use ADO to inhale
the binary file(bootstat.dat), then converted the binary data to string
using a funcion from Michael Harris(byteArrayToHexString). Then
I changed the byte in question(10, base 0), and it was putting the data
back as binary that I was not able to achieve full success with.

My problem seems to be related to the fact that when I conver the string
back to binary, it is then writing back an extra byte(00) back to the file.

If you can shed any light on how you might handle this, that would be nice.

TIA

TDM



Re: wmi or vbscript help by Paul

Paul
Fri Jul 27 13:30:38 CDT 2007


"TDM" <rpuffd@gmail.com> wrote in message
news:%23uzh0C9zHHA.1100@TK2MSFTNGP06.phx.gbl...
>
> "Paul Randall" <paulr901@cableone.net> wrote in message
> news:%23d$2CzlzHHA.5476@TK2MSFTNGP03.phx.gbl...
>>
>
>> If the file is not too big (5 or 10 megabytes is probably not too big),
>> then the ADODB stream object can be used. There are a few non-obvious
>> things you have to do, outlined in VBScript I posted on
>> microsoft.public.scripting.vbscript newsgroup in February.
>> Groups.google for the string "how to update binary field types in ADO"
>>
>> -Paul Randall
>>
>
> Paul,
>
> File is a meager 2K in size. I had some spare time so I took a wack
> at trying to edit this file and I achieved some level of success, but not
> an acceptable level.
>
> Perhaps you can shed some light on editing binary data in vbs ? I found
> very little useful info from google. What I did was use ADO to inhale
> the binary file(bootstat.dat), then converted the binary data to string
> using a funcion from Michael Harris(byteArrayToHexString). Then
> I changed the byte in question(10, base 0), and it was putting the data
> back as binary that I was not able to achieve full success with.
>
> My problem seems to be related to the fact that when I conver the string
> back to binary, it is then writing back an extra byte(00) back to the
> file.
>
> If you can shed any light on how you might handle this, that would be
> nice.
>
> TIA
>
> TDM

Perhaps it doesn't have to be this complicated.
The FSO object has a number properties or methods that produce stream
objects that are designed to read and write text files. The documentation
does not claim any binary capability. The text can be encoded in one of the
many 8-bit encodings or 16-bit Unicode. But you want to read and write
8-bit binary data.

You can use the Chr() function to create 8-bit characters and ChrW() to
create Unicode characters. Within VBScript strings, every character takes
up 16 bits of space, so you can mix Chr() and ChrW() in the same string.

Unicode files are not identified by some property in the directory; the
first two bytes of the file is the identification and is called the Byte
Order Mark, or BOM. FFFE indicates Unicode in the PC world. The
FSO automatically writes these two bytes to a file when Unicode is
specified, at the time the file is created, and they are not returned as
part of the file contents when it is read as Unicode.

The stream object's reading and writing methods typically have parameters to
specify whether 8-bit (improperly called ASCII) or Unicode text is being
used. If the script lies, and try to write a string containing a Unicode
character to a non-Unicode file, you will get an error. When you open a
file for reading, you can specify whether it is to be read in 8-bit mode,
Unicode mode, or let the system figure it out from BOM. If the script lies,
and tries to read a Unicode file in 8-bit mode, you DON'T get an error. You
can try to use the stream's readall method to return every byte of the
entire Unicode file; some number of bytes near the beginning of the
resulting string will be the actual value of the bytes in the file -- the
first two bytes will be Chr(255) and Chr(254) -- but eventually things go
wrong, with no error indicated, and the bytes of the string don't match the
corresponding byte in the file even through the length of the string will
match the file size (on small files, all bytes may match). On the other
hand, if the first two bytes of the file are not FFFE, then every byte in
the string matches every byte in the file. So, while undocumented, you can
read a binary file if it does not start with FFFE.

So how about just
1) readall the file in 8-bit mode, erroring out if the first two bytes are
FFFE.
2) create a new string as the concatenation of three things:
a) Left-part of file up to the byte that is to be changed
b) Chr(the new byte value)
c) Right-part of the file beyond the byte that is to be changed
3) Write this new string back to the original file, forcing overwrite.

Provide sample code and I will help you with it.

-Paul Randall