I can't replicate this on my system (win7 64-bit, console2 beta version 2.00.147), but it sounds like some madness I fought once upon a time with a 32-bit app launching a 32-bit cmd.exe and getting lost in WOW64's system32 folder (%systemroot%\SysWOW64).
If you're running a 64-bit version of windows, I'd suggest you check your task manager to confirm whether console.exe and cmd.exe are 32-bit or 64-bit.
I was able to work around the issue at that time by creating a symlink to the 64-bit system folder and launching cmd.exe explicitly from there in my 32-bit process.
cd \windows
mklink /d sysnative system32
then make my 32-bit app launch \windows\sysnative\cmd.exe
Very clunky work around, but it may help you, if you're experiencing the same issue.
This will enable Drag & Drop to any script. You can place one of them in SendTo folder and use it afterwards.
Registry Export:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\ShellFile]
[HKEY_CLASSES_ROOT\ShellFile\Shell]
[HKEY_CLASSES_ROOT\ShellFile\Shell\Open]
[HKEY_CLASSES_ROOT\ShellFile\Shell\Open\Command]
@=hex(2):43,00,3a,00,5c,00,70,00,61,00,74,00,68,00,5f,00,65,00,78,00,74,00,5c,\
00,62,00,61,00,73,00,68,00,2e,00,65,00,78,00,65,00,20,00,2d,00,63,00,20,00,\
22,00,73,00,6f,00,75,00,72,00,63,00,65,00,20,00,24,00,30,00,3b,00,72,00,65,\
00,61,00,64,00,22,00,20,00,25,00,31,00,20,00,25,00,2a,00,00,00
[HKEY_CLASSES_ROOT\ShellFile\ShellEx]
[HKEY_CLASSES_ROOT\ShellFile\ShellEx\DropHandler]
@="{86C86720-42A0-1069-A2E8-08002B30309D}"
The hex part actually is "C:\cygwin\bin\bash.exe -c "source $0;read" %1 %*"
which gets encoded in the export.
You probably will want to remove the read
after testing, so you can write scripts that just perform a task without leaving an open window. If you need this for single scripts, you can always add it add their end.
Use assoc .ext=ShellFile
after importing to link any file extension you want with this functionality. The DropHandler in this example works for Windows XP and Windows 7 (probably others too) and basically means "run the command, with all dropped filenames as arguments".
Use this as a script (echotest.ext
) to test basic functionality:
echo $0 $*;
Best Answer
There are some newish experimental features in the Windows 10 console that make it much more *NIX like. For example colors that are no longer constrained to the 16 that were available up until now, cursor shapes, etc.
It is configured from the properties windows as before:
More details can be found here:
https://devblogs.microsoft.com/commandline/new-experimental-console-features/