473,396 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Suggestions regarding Removable Media Needed.

Hello -
I am in need of more help regarding an approach to accomplishing the
following:

We have a need to change the Volume serial numbers of a bunch of
preprogrammed IDE Solid State Drive modules. The modules have
been duplicated and thus the need to change the serial number
on each one. My approach is to use a USB to IDE adapter cable
and write a C# routine which will automate the writing of the serial
#. At this point, I have a routine written that works very well.
The routine calls a number of Win32 API functions (CreateFile, etc)
to accomplish this.

Now the problem... I need to know how to determine whether the Solid
State Drive has been write protected. How do I go about accomplishing
this? These modules have a small slide switch that can be used for
write protecting the module. I want to check to see whether this
module has been write protected before I attempt to change the serial
number. This way I can alert the operator to disable the write
protection. If I attempt to use the GetVolumeInfo function, it does
not work properly. I think what I need to do is to Unmount the drive
and then Mount the drive so that the operating system will read the
attributes correctly for a subsequent GetVolumeInfo call.

Do I have the right idea regarding a valid method? Either way, I need
some pointers as to how and accomplish this. My C# experience is a bit
on the newbie side, so keep that in mind with any suggestions.

Thanks for any advice that you can offer...
Jim
Aug 23 '07 #1
1 1730
In article <46**********************@roadrunner.com>,
jf***@tampaCANTbaySTAND.rrSPAM.com says...
We have a need to change the Volume serial numbers of a bunch of
preprogrammed IDE Solid State Drive modules. The modules have
been duplicated and thus the need to change the serial number
on each one. My approach is to use a USB to IDE adapter cable
and write a C# routine which will automate the writing of the serial
#. At this point, I have a routine written that works very well.
The routine calls a number of Win32 API functions (CreateFile, etc)
to accomplish this.
I would think it might be easier to use WMI:

http://www.eggheadcafe.com/articles/20030511.asp
Now the problem... I need to know how to determine whether the Solid
State Drive has been write protected. How do I go about accomplishing
this? These modules have a small slide switch that can be used for
write protecting the module. I want to check to see whether this
module has been write protected before I attempt to change the serial
number. This way I can alert the operator to disable the write
protection. If I attempt to use the GetVolumeInfo function, it does
not work properly. I think what I need to do is to Unmount the drive
and then Mount the drive so that the operating system will read the
attributes correctly for a subsequent GetVolumeInfo call.
You should be able to try and create a dummy file (via the FileStream
class) and catch the associated exception that would be thrown when the
device is write protected (probably some type of IOException).

--
Patrick Steele (pa*****@mvps.org)
http://weblogs.asp.net/psteele
Aug 26 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Garet Cammer | last post by:
Hi Everyone, I am writing a program to perform backup operations using the VB scripting File System Object to copy to removable media storage devices. The backup operation works fine, but when we...
4
by: Heiko Selber | last post by:
I am trying to find out (using Python under windows) the name of a CD that is currently in the drive specified by a path name. And while I am at it, I'd also like to know whether the specified...
0
by: Ryan | last post by:
I'm writing a utility that needs to be aware of media (CD, DVD, Zip disk, usb stick, etc) insertions and removals. Which seems to be more of a problem than I original imagined. I can't use any...
3
by: Mike Joyce | last post by:
I am trying to write a portable script that will find removable media, such as compact flash, sd card, usb, etc. drive and then upload files from the media. I want this to be portable so that I can...
7
by: glenn | last post by:
Hi can anyone tell me how given a directory or file path, I can pythonically tell if that item is on 'removable media', or sometype of vfs, the label of the media (or volume) and perhaps any...
3
by: webgenius | last post by:
Hello guys, I'm an engineering student and have developed an application as part of my final year project using c++. It's working well. But I'm supposed to design a front end for it. The way I...
4
by: Per Juul Larsen | last post by:
Hi my VB program must always start from a removable disk. In addition, on the removable media to be images of the type *. jpg *. tips. If not the two conditions are present, the programme will end...
1
by: seleam | last post by:
I fliped the Flash Drive Removable Media Bit and i cant undo that,, I did that with a lexar program inorder to make 2 partitions for my kingstone 64 gb flash memo.but it dint work tho. and then it...
0
by: samvb | last post by:
Is there any quick way to detect the insertion of a removable media with vb6? Get its drive letter at run time?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.