We help IT Professionals succeed at work.

Floppy Disk management and Registry edit

wagio
wagio asked
on
I want to format a floppy disk to 1.64 MB, and write something in the last sector. Then I format the disk back to 1,44 MB. Can I write a program to reformat the disk and read the data in the last sector (as before reformatting)?
Can I make a Registry key in Windows and how to read it back???
Comment
Watch Question

Commented:
I dont know about formating a disk to 1.64 meg??? but you should look at savesetting() getsetting() functions
Ark
CERTIFIED EXPERT

Commented:
Hi
1. It's hard enough with VB. For NT sample take a look at

under w95/95 seems to be impossible, the only chance is to write direct machine code and execute it (see my sample how to use machine codes from VB at ).

2. If you're not against WScript, the easiest way:

Dim WshShell As Object
Set WshShell = CreateObject("WScript.Shell")
'Create value under the key
WshShell.RegWrite "HKCU\MyKey\MyValue", "Some string value"
'Create a key
WshShell.RegWrite "HKCU\MyKey\MySubKey\", 1 ,"REG_DWORD"

'Read from registry
Debug.Print WshShell.RegRead("HKCU\MyKey\MyValue")   ' Read from value "MyValue".
Debug.Print WshShell.RegRead("HKCU\MyKey\MySubKey\") ' Read from key "MySubKey".

Set WshShell = Nothing

Cheers

Commented:
Example for registry key writing and reading

GetSetting(appname, section, key[, default])

SaveSetting appname, section, key, setting
Ark
CERTIFIED EXPERT

Commented:
Hi
1. It's hard enough with VB. For NT sample take a look at
http://perso.wanadoo.fr/vbfrood/english/projects/drvread.htm (or source at http://perso.wanadoo.fr/vbfrood/dwlproj/drvread.zip)
under w95/95 seems to be impossible, the only chance is to write direct machine code for BIOS interrupt and execute it (see my sample how to use machine codes from VB at http://www.freevbcode.com/ShowCode.Asp?ID=1863).

2. If you're not against WScript, the easiest way:

Dim WshShell As Object
Set WshShell = CreateObject("WScript.Shell")
'Create value under the key
WshShell.RegWrite "HKCU\MyKey\MyValue", "Some string value"
'Create a key
WshShell.RegWrite "HKCU\MyKey\MySubKey\", 1 ,"REG_DWORD"

'Read from registry
Debug.Print WshShell.RegRead("HKCU\MyKey\MyValue")   ' Read from value "MyValue".
Debug.Print WshShell.RegRead("HKCU\MyKey\MySubKey\") ' Read from key "MySubKey".

Set WshShell = Nothing

Cheers

Author

Commented:
Must I use API function to read and write registry?
For your information, I want to make a program that can read from logical sector 3000s (that means over 1.44 MB) to check my watermark.

Commented:
No you dont need api to read/write registry lokk at my example, it is very easy.

Commented:
Get/SaveSetting write to a little backwater of the registry called something like 'VB and VBA Program Settings', so it's best to use the API for proper registry manipulation; it's not too difficult.

Author

Commented:
I haven't find an answer for my problem. Can I format 1,64MB and write something at the end sector. Then I format 1,44 MB back. Am I able to read the written material int the last sector of 1,644MB?

Commented:
So what are saying andyclap than Get/SaveSetting wont -"make a Registry key in Windows and how to read it back???"
Ark
CERTIFIED EXPERT

Commented:
>>I haven't find an answer for my problem. Can I format 1,64MB and write something at the end sector.
Then I format 1,44 MB back. Am I able to read the written material int the last sector of 1,644MB?<<
Yes, you can, but not with VB directly (and AFAIK with API32 too.) Are you familiar with DDK? Windows 'hide' hardware resources from programmers. Seems you need write (or use) 16-bit service (vxd) for your task.

Cheers

Commented:
xSinbad - of course you're right, no offence meant, I was just pointing out that it's not too difficult to manipulate the main registry areas with a bit of api or script.

Author

Commented:
ok, ark... I think your answer is closely right. But I still didn't get any answer. I'll give U the points if you can help me to write a chunk of program to:
GET PROCESSOR ID FROM PENTIUM III and above (in Visual Basic of course)
Thanks before
CERTIFIED EXPERT
Commented:
Seems you're trying to make software protection?
Just FYI - >>The Intel? processor serial number control utility is a Windows* program that enables or disables the reading of the Pentium III processor serial number by software.<< It can be free download from http://support.intel.com/support/processors/pentiumiii/snum.htm

BTW, take a look on my recent submission at
http://www.freevbcode.com/ShowCode.Asp?ID=3292
may be you find it usefull?
Cheers
Ark
CERTIFIED EXPERT

Commented:
Some more info:
>>Intel Corp. says it plans to remove the controversial processor-ID technology from its next-generation PC processor and from future processors, ending a year-long battle with privacy advocates over the invasive technology.
"We made the decision earlier this year," said George Alfs, a spokesman for Intel (Nasdaq: INTC) said Thursday. "We are not planning for (the chip ID) in our next processor."
Alfs said the rise of digital-signature technology has made the need for chip IDs obsolete<<

Cheers

Explore More ContentExplore courses, solutions, and other research materials related to this topic.