Page 1 of 1 1
Topic Options
#85485 - 2002-04-10 12:38 AM NEED HELP-> XP, Device Manager, and Disabling/Enabling Devices
azure Offline
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 [Smile]

-Big Jim

Top
#85486 - 2002-04-23 03:13 PM Re: NEED HELP-> XP, Device Manager, and Disabling/Enabling Devices
BrianTX Offline
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 Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Does this article help?

http://cwashington.netreach.net/depo/view.asp?Index=459&ScriptType=vbscript

- Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#85488 - 2002-04-24 10:55 PM Re: NEED HELP-> XP, Device Manager, and Disabling/Enabling Devices
BrianTX Offline
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
#85489 - 2003-05-20 07:12 PM Re: NEED HELP-> XP, Device Manager, and Disabling/Enabling Devices
Breaker Offline
Hey THIS is FUN
*****

Registered: 2001-06-15
Posts: 268
Loc: Yorkshire, England
Thought I'd resurrect this thread since I've just come across an almost identical problem.

A user's OS has just been upgraded from NT4.0 to W2K. As a result, one particular application that used to function reliably is no longer working. This basically uses a modem to dial up to an external data source.

It appears that the COM port is inaccessible after a reboot until it is disabled/re-enabled, after which time it works fine.

I don't feel like shelling out ona MSDN sub or a copy of the DDK, so - does anyone know of a way to get hold of disabler.exe to test it out, or do they have another solution?

Cheers, guys.

Breaker
_________________________
================================================
Breaker


Top
#85490 - 2003-05-20 09:37 PM Re: NEED HELP-> XP, Device Manager, and Disabling/Enabling Devices
Richie19Rich77 Offline
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) [Big Grin]

So let me know what you need and what CD it might be on and I will look at work tomorrow.

Rich

Top
#85491 - 2003-05-20 10:32 PM Re: NEED HELP-> XP, Device Manager, and Disabling/Enabling Devices
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
richard, that's illegal talk and they can sue you for it! [Mad]
_________________________
!

download KiXnet

Top
#85492 - 2003-05-20 10:39 PM Re: NEED HELP-> XP, Device Manager, and Disabling/Enabling Devices
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
disabler.exe is part of the Windows Driver Development Kit ( http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ddtools/hh/ddtools/disabler_029f.asp )
_________________________
There are two types of vessels, submarines and targets.

Top
#85493 - 2003-05-21 10:10 AM Re: NEED HELP-> XP, Device Manager, and Disabling/Enabling Devices
Richie19Rich77 Offline
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. [Eek!]

Rich

Top
#85494 - 2003-05-21 01:32 PM Re: NEED HELP-> XP, Device Manager, and Disabling/Enabling Devices
azure Offline
Fresh Scripter

Registered: 2001-12-17
Posts: 14
Loc: Tampa, FL
quote:
disabler.exe is part of the Windows Driver Development Kit ( http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ddtools/hh/ddtools/disabler_029f.asp )

Fair enough. Can you post a URL link to said DDK? I remember looking for it at one time but was always referred to being a member of MSDN or somesuch.

-Big Jim

Top
#85495 - 2003-05-21 02:13 PM Re: NEED HELP-> XP, Device Manager, and Disabling/Enabling Devices
Breaker Offline
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? [Wink]

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. [Wink]

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
#85496 - 2003-05-21 02:19 PM Re: NEED HELP-> XP, Device Manager, and Disabling/Enabling Devices
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I would rather search a way to release the port than disabling-enabling.
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1452 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.101 seconds in which 0.063 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org