Visual Basic/VB >> Device lock query.

by amitb » Mon, 06 Oct 2003 15:26:38 GMT

Hi,

I am working on small project on device lock and looking soln for
follwoing query.

a. Is there any way to lock/unlock Removable Drive (CD ROM, Floppy
Disk) of a machine.
I have noted DeviceIOControl api but its effect last only put to
session
(If machine is rebooted CD ROM is unlocked automatically).

b. Disable/enable RUN command for START menu.
c. Disable/Enable Serial, Parallel and USB port.

But for all its effect must remain permanently and NOT till session
exists.
Any supporting code in C,C++,VC++ will do.

Any help is highly appreciated.

Amit


Visual Basic/VB >> Device lock query.

by Aaron Lawrence » Mon, 06 Oct 2003 17:21:27 GMT





Then you probably need to write a program (or device driver) that does
this at bootup. Just a suggestion. Otherwise, there is no way. Perhaps
you could look at the BIOS.




Similar Threads

1. USB device on serial port locks program when disconnected

I have an application that interfaces with a USB device using the .Net
serial port. The code works fine, displaying live data on the screen;
that is until the USB lead is pulled out from the PC when the program
hangs.

The obvious answer is not to pull the lead out, but unfortunately the
application is one in which there is a high possibility the lead will
be pulled out so the code needs to be more robust.

The form has a timer (System.Windows.Forms.Timer) that sends a request
to the device for data. The returning data is handled by the
DataReceived event of the serial port and uses a delegate to process
the data, ultimately displaying it on the form.

The timer code first checks to ensure the port exists (Not IsNothing)
and that it is open (IsOpen) before sending the request data command.

I am struggling to see what I can do to prevent the application from
hanging when the lead is disconnected (and the port is open).

Any help greatly appreciated.

Jeremy.

2. Electronic Door Locking Security Device - VB.Net - VB.Net

3. Query Device Manager ???

I have a script that wakes all our computers at night and does various
checks.
Is it possible to check if there are any problems in the device manager,
such as those entries with yellow question marks?
We imaged a whole load of machines without the correct chipset drivers so I
need to track them down.


4. Querying Device Capabilities using Dx7Vb.dll

5. Querying serial ports device information. Getting "unfriendly" identifier

Im not using VB but I couldnt find a c# group covering windows api calls.

I want to fill a list box with the "friendly" names for the serial ports 
installed on a system, yet I also need to query the names required to 
connect to that port.
ie I enumerate the friendly names of the Ports using the 
SetupDiGetDeviceRegistryProperty api call passing SPDRP_FRIENDLYNAME to get 
the friendly name "Prolific USB-to-Serial Comm Port (COM3)", but I also need 
to know how to get the "COM3" part on its own.
I tried changing the  SPDRP_FRIENDLYNAME to several other possible 
parameters available to that api call but didn't get "COM3" from any of 
them.



SetupDiGetDeviceRegistryProperty(NewDeviceInfoSet,
DeviceInfoData,
SPDRP_FRIENDLYNAME,
0,
DeviceName,
MAX_DEV_LEN,
IntPtr.Zero) ) 


6. Row Level Locking from Excel VBA query

7. Query database without LOCK

"Li Pang" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...
>
>
>
> Hi,
>
> The below sql statement can be used to avoid any deadlock.
>
> SELECT au_lname FROM authors WITH (NOLOCK)
>
> My question is: is there a ADO method to do the same job? i.e., I want to
used the regular sql statement (Without using WITH (NOLOCK) syntax).
>

No. But if you issue the following command previously on the connection

  SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

Then all subsequent queriws will execute as if you had used the NOLOCK hint.

You may be able to achieve the same thing with the ADO Connection object
setting

  con.IsolationLevel Property = adXactReadUncommitted

But that will depend on the OleDb provider, you are using.

David



8. Query an MS-Access record locking file (ldb)