3

I searched a lot the last days and can not find what I'm missing. We are using scripts (vbs, Python, Groovy) heavily for testing. Last days I got a new notebook with Windows 10 and now the scripts do not give output. They run but it is like Windows swallowa stdout, also redirect to a file does not work. The others in my team do not have Windows 10 yet, so I am not sure this is specific to Windows 10 or my computer. Our IT could not help either.

When I give cscript.exe, python.exe or groovy.exe left of the script name all is fine, but not when I call the scripts through file association. They run, but silently!

I reinstalled Python and Groovy, so ftype and assoc are okay as given in How to run VBScript from command line without Cscript/Wscript or Perl not running in Windows 10.

I also checked InheritConsoleHandles in HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\ as hinted in Cannot redirect output when I run Python script on Windows using just script's name.

We have too many places we would need to put the exe call in front of, there needs to be a better solution. Please help.

RaviSriva
  • 31
  • 3
  • Since not programming related this question should me migrated to [SU] –  Jul 23 '17 at 11:37

1 Answers1

2

I encounted the same, I mean this is Windows 10's Explorer specific. If you save the following to a *.reg file

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"InheritConsoleHandles"=dword:00000000

and double-click it, it should work.

See https://social.msdn.microsoft.com/Forums/en-US/f19d740d-21c8-4dc2-a9ab-d5c0527e932b/nasty-file-association-regression-bug-in-windows-10-console for an explanation. Really nasty.

And I would not rely on this, as Microsoft could change (fix?) the behavior back with an update, i.e.

"InheritConsoleHandles"=dword:00000001

would be needed again (the value I had originally in my Windows 10 system and produced the problem).

thoku
  • 1,120
  • 9
  • 27
  • I have this now on Windows 10. To me the only way to solve this was to execute Python with a full path to the exe. Changes in the registry didn't help. – Crouching Kitten Sep 13 '19 at 19:05
  • thanks! setting this to 0 (or deleting the key!) works for me. the issue only appeared on one of my systems, which had the key (set to 1); the working one didn't even have the key. for anyone reading: YES, microsoft apparently SWITCHED the meaning of the values. – Christoph Rackwitz Oct 05 '19 at 14:53