How do I Read/Write BOOT SECTOR in VB 4.0 
Author Message
 How do I Read/Write BOOT SECTOR in VB 4.0

How do I read/write to the boot sector of a floppy or hard disk in VB
4.0? I basically need to find out what the volume label is and
possibly change it. I checked C++ and couldn't find a way either.
Unless someone knows a way.
Thanx,
Eric Schweda



Sun, 27 Feb 2000 03:00:00 GMT  
 How do I Read/Write BOOT SECTOR in VB 4.0

I may be grasping at straws, but the Volume Label is not stored in the
Boot sector.  It is in a directory entry of the root.  Look at the Dir
function in the online help.  Now if you are talking about the Volume
Serial Number, That probably involves using some API to get it.

Quote:
> ----------

> Posted At:         Tuesday, September 09, 1997 11:17 PM
> Posted To:         misc
> Conversation:      How do I Read/Write BOOT SECTOR in VB 4.0
> Subject:   How do I Read/Write BOOT SECTOR in VB 4.0

> How do I read/write to the boot sector of a floppy or hard disk in VB
> 4.0? I basically need to find out what the volume label is and
> possibly change it. I checked C++ and couldn't find a way either.
> Unless someone knows a way.
> Thanx,
> Eric Schweda




Sun, 27 Feb 2000 03:00:00 GMT  
 How do I Read/Write BOOT SECTOR in VB 4.0

Try this:

        VolumeName$ = Dir$("C:*.*",ATTR_VOLUME)

where the constant ATTR_VOLUME = 8.

The volume name is stored as other file names but with the special
attribute of 8.

Hope this helps.

Quote:
> > ----------

> > Posted At:    Tuesday, September 09, 1997 11:17 PM
> > Posted To:    misc
> > Conversation:         How do I Read/Write BOOT SECTOR in VB 4.0
> > Subject:      How do I Read/Write BOOT SECTOR in VB 4.0

> > How do I read/write to the boot sector of a floppy or hard disk in VB
> > 4.0? I basically need to find out what the volume label is and
> > possibly change it. I checked C++ and couldn't find a way either.
> > Unless someone knows a way.
> > Thanx,
> > Eric Schweda




Sun, 27 Feb 2000 03:00:00 GMT  
 How do I Read/Write BOOT SECTOR in VB 4.0

The user will love that when all the programs which check for a particular
vsn suddenly quit working.
--
Chuck Stuart - Mesquite, TX
VBTrace32 - runtime procedure trace, cross reference, automatic error code,
much more. VB 3/4/5. Windows 3.1/95/NT. http://www.metronet.com/~cstuart



Quote:
> How do I read/write to the boot sector of a floppy or hard disk in VB
> 4.0? I basically need to find out what the volume label is and
> possibly change it. I checked C++ and couldn't find a way either.
> Unless someone knows a way.
> Thanx,
> Eric Schweda




Mon, 28 Feb 2000 03:00:00 GMT  
 How do I Read/Write BOOT SECTOR in VB 4.0

This is a multi-part message in MIME format.
--------------1A0A7532D9A43E30BE0382C9
Content-Type: text/plain; charset=us-ascii
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Transfer-Encoding: 7bit

Quote:

> How do I read/write to the boot sector of a floppy or hard disk in VB
> 4.0? I basically need to find out what the volume label is and
> possibly change it. I checked C++ and couldn't find a way either.
> Unless someone knows a way.
> Thanx,
> Eric Schweda


Should be an API call, probably undocumented.  I don't remeber seeing
one.  The other way will be to go at hardware level using low-level BIOS
interrupt (sometimes called Ring 0), but forget that on Windows NT, and
probably on Windows 98 since integrity should be enforce to meet (or at
least try) Windows NT integrity.

--------------1A0A7532D9A43E30BE0382C9
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Yanick Poirier
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Yanick Poirier
n:              Poirier;Yanick
org:            DSR Informatique Inc

title:          P.D.G. / C.E.O.
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
end:            vcard

--------------1A0A7532D9A43E30BE0382C9--



Mon, 28 Feb 2000 03:00:00 GMT  
 How do I Read/Write BOOT SECTOR in VB 4.0

Does that mean that you DON'T know how to do it?

Eric



Quote:
>The user will love that when all the programs which check for a particular
>vsn suddenly quit working.
>--
>Chuck Stuart - Mesquite, TX
>VBTrace32 - runtime procedure trace, cross reference, automatic error code,
>much more. VB 3/4/5. Windows 3.1/95/NT. http://www.metronet.com/~cstuart



>> How do I read/write to the boot sector of a floppy or hard disk in VB
>> 4.0? I basically need to find out what the volume label is and
>> possibly change it. I checked C++ and couldn't find a way either.
>> Unless someone knows a way.
>> Thanx,
>> Eric Schweda




Wed, 01 Mar 2000 03:00:00 GMT  
 How do I Read/Write BOOT SECTOR in VB 4.0

Quote:

>Does that mean that you DON'T know how to do it?

Helpful hint:  it's kind of stupid to write a virus that can't be
distributed in fewer than two diskettes.

--



Wed, 01 Mar 2000 03:00:00 GMT  
 How do I Read/Write BOOT SECTOR in VB 4.0

Quote:


> >Does that mean that you DON'T know how to do it?
> Helpful hint:  it's kind of stupid to write a virus that can't be
> distributed in fewer than two diskettes.

Also, people like me who are honest but tend to upgrade
hardware at the drop of a hat (*any* hat) will tend to
be very angry, and very vocal about it, when my software
suddenly stops working simply because I swapped out my
hard drive for a nice new Ultra/Wide SCSI 9GB leviathan,
confusing some half-witted copy-protection scheme...

[snip]

--

WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!



Wed, 01 Mar 2000 03:00:00 GMT  
 How do I Read/Write BOOT SECTOR in VB 4.0


writes:

Quote:
>How do I read/write to the boot sector of a floppy or hard disk in VB
>4.0? I basically need to find out what the volume label is and
>possibly change it. I checked C++ and couldn't find a way either.
>Unless someone knows a way.

Your best bet would probably to use C or assembly language, read in the
contents of sector 0 using the BIOS calls, save them as a file, and then
your VB program could read the contents of the file. I don't think Win 95
likes this kind of thing, assembly language code which I used to use on Win
3.11 is not allowed by Win 95 (directly). There are so many API calls that
I'm sure there will be one for this, especially since it is displayed in
every drive list box that you use!

      Shiva
--
"Information is Knowledge, Knowledge is Power, Power is Dangerous"
"Information Overload... I've a thousand pages on it..."
"Play with fire - burn your fingers"



Wed, 01 Mar 2000 03:00:00 GMT  
 How do I Read/Write BOOT SECTOR in VB 4.0

Have I missed the point? What's wrong with the Dir function in VB?
Mark Dootson



Thu, 02 Mar 2000 03:00:00 GMT  
 How do I Read/Write BOOT SECTOR in VB 4.0

Let's try something useful folks...

Declare Function GetVolumeInformation Lib "kernel32" Alias
"GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal
lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long,
lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long,
lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal
nFileSystemNameSize As Long) As Long

Quote:
> > ----------

> > Posted At:    Tuesday, September 09, 1997 11:17 PM
> > Posted To:    misc
> > Conversation:         How do I Read/Write BOOT SECTOR in VB 4.0
> > Subject:      How do I Read/Write BOOT SECTOR in VB 4.0

> > How do I read/write to the boot sector of a floppy or hard disk in VB
> > 4.0? I basically need to find out what the volume label is and
> > possibly change it. I checked C++ and couldn't find a way either.
> > Unless someone knows a way.
> > Thanx,
> > Eric Schweda




Thu, 02 Mar 2000 03:00:00 GMT  
 How do I Read/Write BOOT SECTOR in VB 4.0

x=shell("vol [drive:] > c:\vol.txt")
wait 1 second
then read in vol.txt to your variables for parsing.

That's the quickest way to go for me, 'cause I don't have to research it.  
There probably is a call, lord knows what it'd be called mabey GetVolInfo?
-Terry



|Does that mean that you DON'T know how to do it?
|
|Eric
|


|
|>The user will love that when all the programs which check for a
particular
|>vsn suddenly quit working.
|>--
|>Chuck Stuart - Mesquite, TX
|>VBTrace32 - runtime procedure trace, cross reference, automatic error
code,
|>much more. VB 3/4/5. Windows 3.1/95/NT. http://www.metronet.com/~cstuart
|>
|>


|>> How do I read/write to the boot sector of a floppy or hard disk in VB
|>> 4.0? I basically need to find out what the volume label is and
|>> possibly change it. I checked C++ and couldn't find a way either.
|>> Unless someone knows a way.
|>> Thanx,
|>> Eric Schweda

|>>
|>>
|
.

.

-Terry Spragg

remove *nospam* from return address to reply



Fri, 03 Mar 2000 03:00:00 GMT  
 How do I Read/Write BOOT SECTOR in VB 4.0



Quote:
> x=shell("vol [drive:] > c:\vol.txt")
> wait 1 second
> then read in vol.txt to your variables for parsing.

> That's the quickest way to go for me, 'cause I don't have to research it.
> There probably is a call, lord knows what it'd be called mabey
GetVolInfo?
> -Terry

Check the help for Dir$ -- it can retrieve volume labels.  I do not believe
it can change them.
--
Please reply through the newsgroup.  The reply e-mail
address is garbage to reduce the spam rate.


Fri, 03 Mar 2000 03:00:00 GMT  
 How do I Read/Write BOOT SECTOR in VB 4.0

To read Volume Label use Dir function
To write Volume Label (in Win3.11 /95), put dos LABEL command in batch
file, shell batch file passing new label as a parameter.

Its my kludge and I'll try it if I want to.



Sun, 05 Mar 2000 03:00:00 GMT  
 
 [ 14 post ] 

 Relevant Pages 

1. Write to boot sector with VB?

2. Writing to Boot Sector

3. Writing to floppy disk boot sector - how ?

4. Read Boot Sector

5. Reading the boot sector.

6. Reading the boot sector

7. Reading the boot sector and partition table into memory

8. Reading the boot sector and partition table

9. read/write directly disk sectors.

10. Reading/Writing Sector Directly Under Windows 98/ME

11. Reading/Writing Sectors

12. How to read and write sectors to floppydisk

 

 
Powered by phpBB® Forum Software