New answers tagged

0

you can do one of two things: Put all variables in System Variables instead of User and add the ones you want to PATH Or Put all variables in User Variables, and create or edit the PATH variables in User Variable, not In System. The Path variables in System don't expand the User Variables. If the above are all correct, but the problem is still present, you ...


1

Some ideas come to mind (ranked by ease): Download Forklift (also in App store) and enable "Show Invisible Files" in View You could try download another terminal (I prefer iterm) Use your favorite text editor to make a script that does something like rm -r ~/.git As above, but make a script that does defaults write com.apple.finder AppleShowAllFiles YES ...


1

How do I find a running Process Name given it's "File description" property value? Improved solution (thanks to @BenN following discussion in chat): Use the following PowerShell Script (Get-ProcessName.ps1). $_match=$Args[0].ToLowerInvariant() Get-Process | where {$_.Description -ne $null -and $_.Description.ToLowerInvariant().Contains($_match)} | select ...


1

You want to set the volume to a specific level and not add/subtract from the existing volume level. Use a different parameter called setsysvolume. NirCMD setsysvolume: Set the volume to the highest value: nircmd.exe setsysvolume 65535 If you multiply 65535 with 0.75 you get 49151: nircmd.exe setsysvolume 49151


0

ftp -nv yourftpserver.com then user your_username or user anonymous I posted this answer since ftp ftp://username:password@my.domain.com did not work for me. Usage: { ftp | pftp } [-46pinegvtd] [hostname] -4: use IPv4 addresses only -6: use IPv6, nothing else -p: enable passive mode (default for pftp) -i: turn off prompting during mget ...


0

Check out https://github.com/tmux-plugins/tmux-resurrect - I've been using that on OSX to persist sessions between reboots.


0

As a weekend project, I just created mintty-colors, that can be used to switch between color schemes on the fly. It comes with a few predefined themes, and you can add additional themes by creating a config file in your home directory.


0

Is there anything displayed if you run npm get prefix ? (For example's sake, I'll say "/usr/local" is returned after running the command) If anything is returned after running the above command, check what your PATH environment variable is set as by running echo $PATH (Again for example's sake, I'll say "/usr/bin:/bin:/usr/sbin:/sbin" is returned after ...


1

I need a batch file that opens cmd, runs two commands, and keeps cmd open taskkill /F example.exe This is an invalid command. You need to use: taskkill /F /IM example.exe /IM image name. The image name of the process to be terminated. Wildcard '*' can be used to specify all image names. Use the following batch file (test.cmd): @echo off setlocal ...


-1

Try :start taskkill /F example.exe start example.exe pause goto start taskkill /F example.exe and start example.exe are taken from the questions pause waits for user input in the command line goto start then reruns the commands by going to :start again


1

~ is resolvable in your shell but mount has no idea what it means to the shell and to you. Use full path. The command like sudo mount -t cifs -o rw //10.10.10.1/Atkins ~/Desktop/Atkins should work because the shell expands ~ and passes full path to mount. Yet if mount reads its arguments from /etc/fstab then it treats ~ literally as a part of the ...


0

You can use a combination of two utilities to achieve what you want: DelAge32: delage32 x:\*.* 10 /recurse RmEmpty: rmempty x:\ Similar to you, I use both tools to delete system logs older than 10 days. This is all performed via command line in a .bat file. Tested in Windows XP, 7, and 10.


-1

This is what worked for me: net localgroup administrators name domain\mydomaingroup /add


0

Well the solution that works for me is this: in ~/.bashrc I had the lines # enable programmable completion features (you don't need to enable # this, if it's already enabled in /etc/bash.bashrc and /etc/profile # sources /etc/bash.bashrc). if ! shopt -oq posix; then if [[ -f /usr/share/bash-completion/bash_completion ]]; then . ...


0

Had to dig through the zshcompsys manual to find out the right commands The below code at the end of ~/.zshrc works for me function _my_completions() { local -a mywords mywords=( foo bar ) compadd -a mywords } compdef _my_completions -first- The important flag here is the context -first- . As per zshcompsys man page -first- This is tried ...


0

sed -nr '/sub-title/ {N;s,/desc,&,;Tprint;s,<sub-title[^>]+>(.*)</sub-title>\n(<desc[^>]+>)(.*</desc>),\2\1 : \3,;:print};p' <<<'<programme start="500 -05" stop="700 -5" channel="Channel_ID"> <title lang="en">Program Name</title> <sub-title lang="en">Subtitle Example</sub-title> ...


0

From command prompt: go to c:\Master Type del *.* /s /q This will delete all files inside c:\Master but leave the folders alone


1

I know Process Monitor 3.2 will do what you want, but it is known primarily as GUI based tool. If you type procmon /?, you get a list of command line options. My suggestion would be to export a configuration (.pmf) and use it to export a CSV or XML file for analysis. Unfortunately, having to create a configuration file beforehand does not allow you to just ...


0

There is no command-line tool for performing what you're wanting to do. However, you can write a small script/application that can do this. It would: Mount all of the user registry hives Search for each HKU mounted hive for the key Unmount all of the hives Mounting hives takes Administrator rights...


1

Turns out fish 2.3 fixes the printing behavior and leaves the command-line unescaped. In fish 2.3 commandline -b prints the command-line unescaped.


0

This does not answer your question I think, but I found this online somewhere function bind_edit_commandline set -l tmp (mktemp /tmp/fish-fc.XXXXXX) commandline > $tmp eval $EDITOR $tmp commandline -r "" cat $tmp | while read -l cmd; commandline -a "$cmd" ""; end rm $tmp end And I like Altv, so bind \ev bind_edit_commandline


0

yet another way in a batch file to get boot time with wmic but in human readable form : for /f %%a in ('WMIC OS GET lastbootuptime ^| find "."') DO set DTS=%%a set BOOTTIME=%DTS:~0,4%-%DTS:~4,2%-%DTS:~6,2% %DTS:~8,2%:%DTS:~10,2% echo %BOOTTIME%


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 ...


0

Try to specify explicitly the path to private key file, using the -oIdentityFile=/path/to/id_rsa parameter example : sftp -oBatchMode=no -oIdentityFile=/home/username/.ssh/id_rsa -b - username@192.168.1.2 << ! cd /directory put filename.txt bye !


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 ...


0

If you don't specify -f nor -d, find with show you all types of inodes (files, directories, devices, link etc...). If you want files and directories only, then use -o, and possibly use escaped parenthesis if you are going to use other type of conditins. For example, all files, directories, links etc.... which have been modified/created in the past 2 days: ...


0

I just found that SoX can actually do reverb, EQ and compression. http://sox.sourceforge.net/sox.html


0

There are several weird lines in the code. For example: PRODUCT=echo ${PRODUCT} | tr -d '\r' This assigns the string "echo" into $PRODUCT, and runs ${PRODUCT} | tr -d '\r' with the previous value of $PRODUCT. What you need is command substitution: filename=${1##*/} extension=${filename##*.} sz=$(stat -c %s "$1") product=$(bc <<< "scale = 10; ( ...


0

For sake of the completeness, I am posting here the full "ugly-but-it-works" solution (with the amends that, in its final form, it sends emails to more people, as well as provides an attachment): cd "$(dirname "$0")" working_dir=$(pwd) # switching to the folder this script has been started from cvs_domain=mail.org cvs_mail_server=mail.${cvs_domain} ...


0

This is the only one that worked for me without any operations besides clicking the script file: http://www.askvg.com/create-simple-script-to-show-hide-file-extensions-in-windows-xp-vista-and-7/


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 ...


0

It's very likely that you need to run as trusted installer. Some programs, like GWX do this. Look for a proggie called runasti.exe on the internet, and it should do the magic,


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.


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


0

I don't want to remove all but one language from my keyboard entry options because I use sometimes Chinese and sometimes English. Is there another solution?


0

env var=value application.exe is possible. Write following batch script, name it env.bat and place it somewhere in a directory from your PATH variable. Please read Command Line arguments (Parameters) and setlocal articles for further explanation. env.bat script: @setlocal @set "%~1=%~2" @%3 Above script applies to given simple command but would require ...


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 ...


0

here is your solution use tskill instead of taskkill Use $ tskill notepad


0

extract file from a zip inside another zip using 7z command line Below is a 7Zip CLI scripted way I did this from a few years back. I've had to use and adjust it a time or two since to accommodate as-needed. This extracts all zip files (and their contents) within other zip files (and their contents) until no other zip files remain to extract from and ...


0

I have the same issue when type just bcdedit in command prompt But if I enter the full path. it works good. C:\Windows\Sysnative\bcdedit My system Windows 10, but 8.1 may be the same.


0

I've used cmdow in the past, and it seems to have worked for what I want. You'll probably want to use one of the following options: CMDOW [window] /HID /HID hides the specified window CMDOW [window] /END /END closes the specified window CMDOW [window] /CLS /CLS politely asked the window to close (some windows may open a dialogue box) Hope this helps. ...


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 ...


0

I wrote ntfy for exactly this purpose. It is cross-platform and can automatically send notifications when long running commands finish. If you have Python's pip (most Linux distros and MacOS have it), here's how to install it and enable automatic notifications: $ sudo pip install ntfy $ echo 'eval "$(ntfy shell-integration)"' >> ~/.bashrc $ # restart ...


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 ...


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: ...


0

I just wanted to add the code that worked in case someone else needs it This is the final line that worked all the thanks go to evilsoup and Mulvya. ffmpeg -i test.mkv -filter_complex 'palettegen[PAL];[0:v]fifo[v0];[v0][PAL]paletteuse' test.gif Also if you want to get winff to work with animated gifs just add these lines to the winff presets.xml file ...


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

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 ...



Top 50 recent answers are included