Hot answers tagged

5

It's possible that your %PathExt% environment variable has garbage in it – it's how cmd.exe knows which file extensions it should try. Normally its contents should be: C:\Users\Mantas>set pathext PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC Use sysdm.cpl → Advanced → Environment Variables to check and fix it.


2

Answering because this was the first DDG result in searching for the same issue. First, you need to get the code for the delete key. Go to your shell prompt, for example: alec@su:~$ Execute the 'cat' program, which you will use to determine which code corresponds to your 'delete' key. alec@su:~$ cat Press 'delete' on your keyboard and cat will ...


2

I have knocked up a batch file env.cmd which works more or less like the Linux env command:- echo off setlocal for %%f in (%*) do ( echo %%f|find "=" >nul: if errorlevel 1 goto DoCmd set %%f shift ) :DoCmd %1 %2 %3 %4 %5 %6 %7 %8 %9 endlocal The only difference is that, because of the way cmd parses, the environment assignments need to be ...


2

You need to use a filterchain (see the FFmpeg wiki and online documentation). ffmpeg -i input.mkv -filter_complex 'palettegen[PAL],[0:v][PAL]paletteuse' output.gif Basically, the palettegen filter takes a single video input (so as long as you don't have more than one video stream amongst your inputs you don't need to specify where the input is) and gives ...


1

powershell -command "get-process | ? {$_.Description -eq 'Sysinter Process Explorer'} | select processname | out-file $env:APPDATA\example.txt" basically you have a powershell command and paste it in between these quotes to call it from CMD powershell -command " #PasteCodeHere " inside these quotes you have to work with ' otherwise it will interrupt ...


1

FINDSTR /I /C:"Registrant Name" Applied next paragraph from findstr artice: Searching for Spaces When the search string contains multiple words, separated with spaces, then FINDSTR will return lines that contain either word (OR). A literal search (/C:"string") will reverse this behaviour and allow searching for a phrase or sentence. A ...


1

ConEmu has forking abitily. So, you may just call -new_console:d:C:\My\Code cmd.exe /c ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64_x86 & ConEmuC -fork -c far" Far Manager has its own Macro system. You may either set up "Auto started" macro, or just pass it via command line. Consider proper quotation! Just change F2 F1 ...


1

Try this exec wine "~/.wine/drive_c/My/program.exe" "-my" The exec commands tell bash to morph into wine with the following arguments, so this is no longer bash running wine, but bash process becoming wine. The PID remains. You don't have two processes running. The solution given to this question can be found on Unix.SE. Transparently run wine ...


1

When you need to script an interactive command-line tool, the typical solution is to use expect(1).


1

This would only work in the case of sequential prompts that are the immediate part of the script as per your example. However in the case of git your values are being passed to the process prior to any username / password prompt - probably while its doing everything (network, etc) before GIT_ASKPASS - For reference: ...


1

Use the -o option. From the find man page (under the OPERATORS heading): expr1 -o expr2 Or; expr2 is not evaluated if expr1 is true.


1

You can circumvent the issue by adding /X to all DIR commands. That will give you the 8.3 short name (DOS-name) of all files; all further operations are valid with this name, and it will not have any of the UTF issues.


1

Setting the codepage to UTF-8 should help : chcp 65001 The dir result will then be encoded in UTF8. If VBS cannot understand it as-is, for the file to be automatically recognized under Windows as UTF8 you will need to prefix it with the UTF8 BOM bytes : 0xEF, 0xBB, 0xBF You can then start with a file containing the BOM and append to it rather than ...


1

The scripts in the other answers only count the first command executed in each command line; they do not include commands executed after pipes (i.e. ' | '). For example, if this line itself was in your bash history: awk '{print $1}' ~/.bash_history | sort | uniq -c | sort -n then in the returned summary of most-executed commands, 'sort' and 'uniq' and ...


1

you can use ported util env from package CoreUtils in GnuWin32 http://gnuwin32.sourceforge.net/ Setup it Check what directory with env.exe exists in %PATH% variable Use same way like linux version env EDITOR=vim command



Only top voted, non community-wiki answers of a minimum length are eligible