sublimnl Posted November 29, 2006 Share Posted November 29, 2006 I have a script that I have written that sits in my systray and provides me with 4 options: Dock, Undock, Undock and Hibernate, and Hibernate. This was originally done to make the repetitive task of docking/undocking my laptop and having to constantly configure all my external monitors (3) and screen resolutions one by one. The one snag I have is that I am using the Send command to send keys ({start}E) in order to tell Windows to undock my laptop. This doesn't seem to work about half the time and the laptop just sits there instead of going through with whatever undock voodoo that Windows does. I then go and click "Undock Computer" from the start menu manually and then Windows finally does its thing, monitors go dim and the ethernet adapter on the dock shows disconnected status. Does anyone know of a better way to initiate the Windows undock sequence programatically so that I can get consistent results from this script? Thanks! Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted November 29, 2006 Share Posted November 29, 2006 I'm unsure as what dock/un-dock a laptop is but is there a potential to just run the program that is a shortcut in your start menu with some parameters ? Link to comment Share on other sites More sharing options...
sublimnl Posted November 29, 2006 Author Share Posted November 29, 2006 I'm unsure as what dock/un-dock a laptop is but is there a potential to just run the program that is a shortcut in your start menu with some parameters ?Undocking refers to whatever process Windows takes to gracefully disconnect the hardware that is part of a laptops docking station before you physically remove it from the dock. Unfortunately it is not a shortcut. It's a system command of some sort...situated below the first seperator along with the "Shut Down..." and "Log off" commands. Link to comment Share on other sites More sharing options...
sublimnl Posted November 30, 2006 Author Share Posted November 30, 2006 anyone? Link to comment Share on other sites More sharing options...
sublimnl Posted June 14, 2007 Author Share Posted June 14, 2007 (edited) resurrecting an old thread of mine. anyone have any ideas as to how i can programatically undock a laptop? EDIT: I just found this VBS script that allegedly does the job. I'm not at work to test right now though. Anyone know what this script does and how to do the same in AutoIt? Set wshshell = CreateObject("Shell.Application") wshshell.EjectPC Edited June 14, 2007 by sublimnl Link to comment Share on other sites More sharing options...
cryn Posted June 14, 2007 Share Posted June 14, 2007 you can use the same object in autoit. $shell = ObjCreate('Shell.Application') $shell.EjectPC Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now