I'm trying to write a macro that will disconnect a network share that is incorrect. Once I select the drive to disconnect and hit the OK button my script just hangs there and I can't seem to hook into the message box that comes up. The message box is titled 'Disconnect Network Drive' and the text inside says 'There are currently files or folders open on H: ...blah blah ... Do you want to disconnect this network drive anyway?'
Doing this manually is fine (no harm done) and I can click on the message box 'Yes' button or press enter - works fine. However, the macro seems to hang as soon as I press the 'OK' button on the initial disconnect window.
Here is the code:
Code: Select all
Run>RUNDLL32 SHELL32.DLL,SHHelpShortcuts_RunDLL Disconnect
WaitWindowOpen>Disconnect Network Drives
Wait>.1
SetFocus>Disconnect Network Drives
Sen>h
Wait>.2
PushButton>Disconnect Network Drives,OK
Wait>.2
MessageModal>This message is not getting hit...
Thanks for any help.