PC Review


Reply
Thread Tools Rate Thread

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

 
 
Michael
Guest
Posts: n/a
 
      20th Jul 2006
I'm exploring how to programmatically disable/enable devices in a system
using C#.



-MH


 
Reply With Quote
 
 
 
 
rhaazy
Guest
Posts: n/a
 
      20th Jul 2006
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


 
Reply With Quote
 
chanmm
Guest
Posts: n/a
 
      20th Jul 2006
If it is not in System.Management namespace then you have no luck for .Net
unless you want to try API.

chanmm

"Michael" <(E-Mail Removed)> wrote in message
news:eNw%(E-Mail Removed)...
> I'm exploring how to programmatically disable/enable devices in a system
> using C#.
>
>
>
> -MH
>
>



 
Reply With Quote
 
Laura T
Guest
Posts: n/a
 
      20th Jul 2006
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" <(E-Mail Removed)> ha scritto nel messaggio
news:eNw%(E-Mail Removed)...
> I'm exploring how to programmatically disable/enable devices in a system
> using C#.
>
>
>
> -MH
>
>



 
Reply With Quote
 
Michael
Guest
Posts: n/a
 
      20th Jul 2006
rhaazy,

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


-MH

"rhaazy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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

>



 
Reply With Quote
 
Michael
Guest
Posts: n/a
 
      20th Jul 2006
Laura,

Thanks, I'll take a look at that.

-MH

"Laura T" <laura.t@_yahoo.com> wrote in message
news:OR86Ki%(E-Mail Removed)...
> 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" <(E-Mail Removed)> ha scritto nel messaggio
> news:eNw%(E-Mail Removed)...
>> I'm exploring how to programmatically disable/enable devices in a system
>> using C#.
>>
>>
>>
>> -MH
>>
>>

>
>



 
Reply With Quote
 
Michael
Guest
Posts: n/a
 
      20th Jul 2006
** "Michael" <(E-Mail Removed)> ha scritto nel messaggio
** I'm exploring how to programmatically disable/enable devices in a system
** using C#.
**
** -MH
* "Laura T" <laura.t@_yahoo.com> scribed
* 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


 
Reply With Quote
 
karan.shashi@gmail.com
Guest
Posts: n/a
 
      28th Jul 2006
| Michael wrote:
| ** "Michael" <(E-Mail Removed)> ha scritto nel messaggio
| ** I'm exploring how to programmatically disable/enable devices in a
system
| ** using C#.
| **
| ** -MH
| * "Laura T" <laura.t@_yahoo.com> scribed
| * 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Enable/Disable Hardware Device (Device Manager) programatically =?Utf-8?B?Um9vdFNweTIwMDY=?= Microsoft C# .NET 2 28th Apr 2006 09:44 AM
How to enable or disable USB storage device? kiros Windows XP Embedded 4 18th Nov 2004 04:26 PM
hide enable/ disable of device veeruchowdary Microsoft Windows 2000 Developer 0 16th Sep 2004 06:30 AM
Re: disable/enable network device driver Steve Duff [MVP] Microsoft Windows 2000 Networking 0 4th Sep 2003 08:02 PM
automatically disable and re-enable a usb device mitchell Windows XP Hardware 0 24th Aug 2003 08:17 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:25 PM.