473,387 Members | 1,440 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,387 software developers and data experts.

Can I use WMI (C#) to disable/enable a device?

I'm exploring how to programmatically disable/enable devices in a system
using C#.

-MH
Jul 20 '06 #1
7 13838
Why would you want to do something like that? The only reason you
would possibly have to do this would be if you were planning to do it
remotely. Because I'm pretty sure you can disable any device locally
without the aid of any third party application. Are your intentions
ethical?????

Michael wrote:
I'm exploring how to programmatically disable/enable devices in a system
using C#.

-MH
Jul 20 '06 #2
If it is not in System.Management namespace then you have no luck for .Net
unless you want to try API.

chanmm

"Michael" <mh***@domain.comwrote in message
news:eN****************@TK2MSFTNGP05.phx.gbl...
I'm exploring how to programmatically disable/enable devices in a system
using C#.

-MH


Jul 20 '06 #3
No. The WDM provider for WMI does not allow to do these things (for some
good reasons).
You need to interface with CfgMgr32 (Win32 API) to do this.

"Michael" <mh***@domain.comha scritto nel messaggio
news:eN****************@TK2MSFTNGP05.phx.gbl...
I'm exploring how to programmatically disable/enable devices in a system
using C#.

-MH


Jul 20 '06 #4
Laura,

Thanks, I'll take a look at that.

-MH

"Laura T" <laura.t@_yahoo.comwrote in message
news:OR****************@TK2MSFTNGP03.phx.gbl...
No. The WDM provider for WMI does not allow to do these things (for some
good reasons).
You need to interface with CfgMgr32 (Win32 API) to do this.

"Michael" <mh***@domain.comha scritto nel messaggio
news:eN****************@TK2MSFTNGP05.phx.gbl...
>I'm exploring how to programmatically disable/enable devices in a system
using C#.

-MH



Jul 20 '06 #5
rhaazy,

It's for testing device drivers purposes.
Don't jump the gun with assumptions, ok?
-MH

"rhaazy" <rh****@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
Why would you want to do something like that? The only reason you
would possibly have to do this would be if you were planning to do it
remotely. Because I'm pretty sure you can disable any device locally
without the aid of any third party application. Are your intentions
ethical?????

Michael wrote:
>I'm exploring how to programmatically disable/enable devices in a system
using C#.

-MH

Jul 20 '06 #6
** "Michael" <mh***@domain.comha scritto nel messaggio
** I'm exploring how to programmatically disable/enable devices in a system
** using C#.
**
** -MH
* "Laura T" <laura.t@_yahoo.comscribed
* No. The WDM provider for WMI does not allow to do these things (for some
* good reasons).
* You need to interface with CfgMgr32 (Win32 API) to do this.
*
Laura T,

I believe Win32 API's setupapi.dll exports a function "SetupDiChangeState"
which allows for this but it's beyond my current skillset to fully
understand how to use it w/o seeing some sort of working C# source code
example. I'll keep plugging away at it. It may be best to start another
thread pertaining to this specific conundrum of mine.

Thanks,
-MH
Jul 20 '06 #7
| Michael wrote:
| ** "Michael" <mh***@domain.comha scritto nel messaggio
| ** I'm exploring how to programmatically disable/enable devices in a
system
| ** using C#.
| **
| ** -MH
| * "Laura T" <laura.t@_yahoo.comscribed
| * No. The WDM provider for WMI does not allow to do these things (for
some
| * good reasons).
| * You need to interface with CfgMgr32 (Win32 API) to do this.
| *
| Laura T,
|
| I believe Win32 API's setupapi.dll exports a function
"SetupDiChangeState"
| which allows for this but it's beyond my current skillset to fully
| understand how to use it w/o seeing some sort of working C# source
code
| example. I'll keep plugging away at it. It may be best to start
another
| thread pertaining to this specific conundrum of mine.
|
| Thanks,
| -MH

Anybody know how to use that API in C#? I'd be interested also in how
all the functions and structures are used along w/ the proper way to
pass parameters.

Jul 27 '06 #8

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

Similar topics

2
by: Derek White | last post by:
Ok here's the deal. We are finally getting DSL again... but our PC is in the living room... and the youngest has figured out that if he hits the right keys... he can bring up Internet Explorer....
0
by: gabedog | last post by:
What would be a good (and safe) way to enable/disable a web site in a web farm that needs to come down for maintenance? Periodically, we have db folks that run db scripts. I'd like to put a back...
2
by: RootSpy2006 | last post by:
Hi All, Problem Definition: --------------------- Microsoft Wirelss Keyboard works in BIOS but does not work when booting into windows. Discovered Work-around: -----------------------------...
4
by: Phoe6 | last post by:
Hi all, I am trying to disable the NIC card (and other cards) enabled in my machine to test diagnostics on that card. I am trying to disable it programmatic using python. I checked python wmi and...
3
by: Pietro | last post by:
Hi all, First of all I'd like to thank you very very much ,as finally after many years of searching,I could find a code to disable/enable the shift key,but actually i cannot use the code as I'm...
0
by: JGilis | last post by:
Whell here's the problem ... i'm working on a barcode program in VB.NET 2005 form. At one point the users will have to identify with 3 letter code like this Homer Simpson will become HSI. They...
0
by: Alexander Vasilevsky | last post by:
Can to disable/enable smoothing font in the WPF? http://www.alvas.net - Audio tools for C# and VB.Net developers
10
by: viki1967 | last post by:
Disable/enable icon.gif Hi all. I have this form in the page.htm: <form action="form.asp" method="post" onsubmit="return(validateForm(this));"> <select size="1" name="t_im"...
1
AR Ratheesh
by: AR Ratheesh | last post by:
Hi, Please help me to disable / enable task manager and Explore for a internet Cafe management project. Thanks in advance..
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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,...

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.