473,626 Members | 3,675 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1741
In article <46************ **********@road runner.com>,
jf***@tampaCANT baySTAND.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.o rg)
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
2591
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 attempt to remove the backup device, we often get a "Delayed Write Failed" error message, indicating that data was cached and the copy was not actually finished before device removal. The problem now is how can we guarantee that all data is...
4
2894
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 drive contains a CD at all, and whether the drive is actually a CD drive. AFAIK, Python doesn't provide a way to do it, and a search in the web yielded only soutions for Linux. Can anyone show me a solution that works with windoze?
0
2231
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 auto-run features because this is actually running on Windows XP Embedded... so that's the first thing to be aware of. Using WM_DEVICECHANGE works about half the time...that is, it works when a DVD or CD is inserted, but it does not work for Zip...
3
3890
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 write and maintain one program for both Linux and Windows. Each platform uses different functions so even if I could find two platform dependent functions that would be fine. Basically, I would like to avoid checking fixed disks if possible. If...
7
2280
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 other details about the media itself? thanks Glenn
3
1627
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 have implemented it is: The user provides the input from command line like prog-name supposed-file-name -level file1 .... prog-name is the executable, supposed file-name is the output file obtained after running the executable, and then the...
4
2902
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 with a message. How do I write this little control function in Visual Basic regards pjl
1
3616
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 started actin crazy ,things being copied by 3 mb/sec ,and do not appear when inserted in another comp. Sorry i donno where to post this question hopin some 1 might help thankful I remain.
0
1054
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
8196
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8637
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8364
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5574
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4092
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1808
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.