Now, while the script is running, simply click with the mouse cursor
somewhere in the powershell's text window. The script will pause and
only continues when you press Enter. It turns out that clicking in the
text area actually invokes the text selection action for clipboard copy
operations.
This is all fine, but initially I got reports from people running my
script that my script paused for no reason at all. Eventually, it turned
out that the pause was caused by mouse clicks in the text window (often
caused when they simply wanted to give focus to the partially hidden
powershell window, after which they left and the script remained paused
until they returned hours later only to come to the conclusion that
nothing had happened in the mean time).
This easy copy-text feature is nice, but I was wondering if there is a
way to disable this (script-wise) so that people aren't able anymore to
accidentally pause the script. Being able to disable this feature would
make my my script more fool-proof.
Thanks,
Kris
The only method I know of changing this is in the registry
HKCU\Console\QuickEdit 0x1 (on) 0x0 (off)
Most of these settings unfortunately aren't reloaded when changed manually.
The user will need to log off.
The Command Console of course has a "special" relationship with it's
properties and does this on the fly if you change it via the menu.
Perhaps someone else will have better news
bob
From what I can tell so far, running something in the background is not
affected:
http://jtruher.spaces.live.com/blog/cns!7143DA6E51A2628D!130.entry
Marco
--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp
PowerGadgets MVP
http://www.powergadgets.com/mvp
Greetings /\/\o\/\/
Nope. MoW is just stating that CMD.exe has the same problem. Can you try
to opening the console Window properties and disabling Quick Edit and see if
that makes the problem go away? If so, you should be able to hack the
registry to temporarily disable "quick edit" in the current console and
re-enable it before exiting.
--
Keith
Not entirely relevant but IIRC, quickedit was newly enabled by default
for windows 2000 (or was it NT4?), then removed again for XP. I
vaguely remember that nugget of console trivia, but I could be wrong.
- Oisin
Yes. Turning Quick Edit off makes the problem go away.
Thanks.
So at least you can go with what Bob says maybe about the registry edit,
then the *next* time, and forever after, the problem will be gone.
Marco
Marco Shaw [MVP] wrote:
> So at least you can go with what Bob says maybe about the registry edit,
> then the *next* time, and forever after, the problem will be gone.
I'm not sure this will work reliably. Currently I have QuickEdit still
enabled in my PowerShell session even though the registry value is set
to 0. Even after log-off or reboot, registry value is zero, but QE is
still enabled.
I've noticed that when I change the window's properties such as the QE
setting, you will be asked if you want to modify the shortcut that
started the session. So, I'm thinking that the registry value is a
global default value, which is easily overruled when the user has
applied the new properties to the shortcut.
Kris