#85485 - 2002-04-10 12:38 AM
NEED HELP-> XP, Device Manager, and Disabling/Enabling Devices
|
azure
Fresh Scripter
Registered: 2001-12-17
Posts: 14
Loc: Tampa, FL
|
Here's the situation:
We need to upgrade from 95 machines to XP and make sure our apps work. We have an old DOS app that requires direct interface with COM1.
We got it working correctly by disabling Fast ROM Emulation and Dynamic Memory Allocation. However, the program doesn't seem to release the COM port after you exit it.
When you open another application that uses the port, it won't use it. I have found, however, that if you DISABLE COM1 and then ENABLE COM1 it fixes the problem. The problem with that is I don't want our users playing in Device Manager.
The port to be disabled/enabled will *ALWAYS* be COM port 1 (3f8 irq 4) and it will Always be XP.
Is there *ANY* way to script this? Thanks in Advance
-Big Jim
|
|
Top
|
|
|
|
#85486 - 2002-04-23 03:13 PM
Re: NEED HELP-> XP, Device Manager, and Disabling/Enabling Devices
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
After playing around with:
$comport = getobject("WinMgmts:Win32_SerialPort='COM1'")
and not getting much to happen with it.. (could always be syntax, or maybe I'd have to use vbscript).. I can only think of the possibility of using SetFocus and SendKeys to go through Windows and actually do the operation. You can open the device manager by shelling to "devmgmt.msc" .. then do the operation. I'm sure there is a better solution, but I'm not a good enough programmer (at this point) to get it to work. lol
Brian
|
|
Top
|
|
|
|
#85487 - 2002-04-23 04:00 PM
Re: NEED HELP-> XP, Device Manager, and Disabling/Enabling Devices
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
|
|
Top
|
|
|
|
#85488 - 2002-04-24 10:55 PM
Re: NEED HELP-> XP, Device Manager, and Disabling/Enabling Devices
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
Hmm. after looking at this some more, I found a utility called disabler.exe that comes with Microsoft's DDK. You might try using that. The documentation on the CM_DisableDevNode function under the cfgmgr.h (cfgmgr.dll -- PNP configuration manager) is non-existent because Microsoft doesn't want people messing with it. Otherwise, you should be able to disable and enable devices using CM_DisableDevNode and CM_EnableDevNode.
Brian
|
|
Top
|
|
|
|
#85490 - 2003-05-20 09:37 PM
Re: NEED HELP-> XP, Device Manager, and Disabling/Enabling Devices
|
Richie19Rich77
Seasoned Scripter
   
Registered: 2002-08-16
Posts: 624
Loc: London, England
|
Hi
Microsoft are kind enough to send us every package they have on CD. (NHS Licencing Agreement)
So let me know what you need and what CD it might be on and I will look at work tomorrow.
Rich
|
|
Top
|
|
|
|
#85493 - 2003-05-21 10:10 AM
Re: NEED HELP-> XP, Device Manager, and Disabling/Enabling Devices
|
Richie19Rich77
Seasoned Scripter
   
Registered: 2002-08-16
Posts: 624
Loc: London, England
|
Of course it is illegal, I do not endorse the use of illegal software or the copying of any Microsoft product that is part of a lincencing agreement.
Rich
|
|
Top
|
|
|
|
#85495 - 2003-05-21 02:13 PM
Re: NEED HELP-> XP, Device Manager, and Disabling/Enabling Devices
|
Breaker
Hey THIS is FUN
   
Registered: 2001-06-15
Posts: 268
Loc: Yorkshire, England
|
Azure,
The link Jens posted takes you to the docs for disabler as a driver dev tool, however, it is currently unavailable for download from Microsoft. Sorry. I whacked their search engine for a while last night and all I find was a message telling me as much, despite their kind offer for me to shell out $200 on a copy of the DDK CD.
Cheeky brit says: how much is that in real money?
Jens,
See above. Thanks for posting the link, though.
Richard,
As Jooel says, that's naughty talk. But thanks for the offer. I have a developer friend who has a subscription - perhaps I can borrow his CD to test the tool. Ahem, but not, of course, to roll out a solution without purchasing a licensed copy.
Cheers, guys. I'll post again if I can get hold of it and if it works. Strange, though, I would have imagined that WMI had some methods to do stuff like this...
-Breaker
PS If there's any other Crows fans out there - check out the new avatar!
_________________________
================================================ Breaker
|
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 1452 anonymous users online.
|
|
|