what is shortcut command to kill process in windows command? - windows

Problem :
I have a process in windows command which cannot be killed. I tried taskkill and all the shortcuts in this post
Linuxlike Ctrl-C (KeyboardInterrupt) for the Windows cmd line?
It refuses to die, even Windows task manager doesn't work to kill the command prompt. This program is resistant.

Ctrl + C should stop a program running from the command prompt, similar to linux.
If that doesn't work try to force kill a process from the command prompt, using the following command:
taskkill /F /IM process.exe
/F will force termination of the process, /IM means you're going to provide the running executable that you want to end, thus process.exe is the process to end.
tried using alt + F4?

I was in a similar situation where exit() and Ctrl+Z were the commands used to escape.
Typically entering exit (or logout) will provide you with assisting information, in my case I had the following output:
Use exit() or Ctrl-Z plus Return to exit

In Windows:
First try: Ctrl + C If it doesn't work then try pressing q
In MAC OS:
Press Cmd + C or Ctrl + C or q

Related

How to clear screen in Windows command prompt window with a hotkey?

I have searched a lot to find a way (keyboard shortcut) to clear the screen of the console window of cmd on Windows 10. I tried Ctrl+L and Ctrl+K and ESC, but nothing worked for me and I didn't find any satisfied solution.
Thanks a lot for the AutoHotkey script.
I modified the script to input Python script to clear the screen when using scrapy shell like that
Send from os import system{Enter}
Send cls = lambda: system)'cls'({Enter}
Send cls)({Enter}
It worked well but I noticed the value 0 at the top of the window.
The console window after execution of AutoHotkey script with █ as blinking caret symbol.
0
>>> █
How can I remove that zero?
The simplest way of clear window in command prompt is typing: cls + enter
Ecs is a key to exit input of command prompt, it does noting on clear window
Ctrl + L and Ctrl + K are not correct short key in Linux command prompt. If you really want to make it a short cut key of cls, you can use AutoHotKey to write a short script
; -------------------------------------------------------------------------
; Cntr-L should clear screen
; -------------------------------------------------------------------------
#IfWinActive ahk_class ConsoleWindowClass
^L::
Send cls{Enter}
return
#IfWinActive
Official website of autohotkey: https://www.autohotkey.com/
Windows 10 + python 3.9 clear command prompt script:
import os
os.system('cls')

VIM "!" and the Windows start command

I have configured <F5> to use the Windows start command, but trying to use the command line option "/wait" confuses VIM so that the command is not found anymore.
Here my old mapping:
noremap <F5> :w<CR>:!start "%:p"<CR>
I changed the mapping to:
nnoremap <F5> :w<CR>:!start /wait "%:p"<CR>
Using the later cause the following error:
E371: command not found
But why "command not found", the command is still "start", isn't it?
Thanks in advance!
Vim implement :!start command it-self since Vim must handle background command correctly. And it doesn't have /wait option. See :help :!start.
Using "start" stops Vim switching to another screen, opening a new console,
or waiting for the program to complete; it indicates that you are running a
program that does not affect the files you are editing. Programs begun
with :!start do not get passed Vim's open file handles, which means they do
not have to be closed before Vim.
To avoid this special treatment, use ":! start".
:nnoremap <F5> :w<CR>:! start /wait %:p<CR>
FYI: original start command doesn't require double-quote for argument.

octave 3.8.1 can't stop execution in gui command window

I'm running octave 3.8 with the gui in Ubuntu 14.04. I have an infinite loop somewhere in my program and it seems like the terminal doesn't respond to the typical keypresses to stop execution. (eg. Ctrl+C, Ctrl+Z) When I run programs in the terminal, I can just press Ctrl+C, but that doesn't seem to work here. What can I do to halt execution?
To stop a running command or script in octave GUI or prompt:
Ctrl+C
you will see:
less -- (f)orward, (b)ack, (q)uit
To abort (and close the GUI or command line):
Control+C
To just stop printing the output of the command or script (?):
q
Enter
It's a long-running bug that hasn't been fixed since 2012, run with --no-gui if possible.
after going through lots of bugs report and all.
Finally by hitting (ctr + c + Enter) at command window (below the pause statment) execution gets terminated.
hope it works for u too.

Sending signal to bash shell launched in GVim

How do I send a signal (say, SIGINT), to a shell launched inside GVim, using a keyboard shortcut?
Neither Ctrl+C nor Ctrl+D seem to work.
Ctrl+D seems to work for me, at least for closing a terminal session. Crl+C however does not. If you only want to kill a running process, you can do this workaround (provided Ctrl+Z) works for you.
Press Ctrl+Z to pause the process, then
kill %1
to kill the process in the background.
Inside vim, use command :shto temporarily exit vim and go to shell
If you want to go back to vim then press Ctrl + D. This work for me for years.

Suppress command window when running console application on Windows

Is there a way to suppress showing the command window when running a console application on Windows XP?
Details: I am calling a (console-based) program from Vim. I would like to avoid the command window being shown every time I do this.
Try start /B <program name> to start the program without a new window.
Did you try shell.vim?
The xolox#shell#execute() function
This function enables other Vim
plug-ins to execute external commands
in the background (i.e.
asynchronously) without opening a
command prompt window on Windows.
i can't believe no one has suggested simply using :silent
for example, I have the following in my .vimrc (gvim on Win7)
"open windows explorer to the directory of the current file
:map <leader>ex :silent !Explorer %:p:h<CR>
When I didn’t want to see the output of external commands called from the Vim command line, I would prepend them with :silent. However, this results in a command window momentarily flashing on screen when running GVim under MS Windows. After a short while, I got annoyed by this behaviour so I researched alternative solutions (which is how I came across this question).
The best solution I came up with was to use Vim’s inbuilt system function which runs shell commands without opening an external command window. While the output of the shell command is not printed, its exit status is conveniently available via v:shell_error. It also has the advantage that it’s portable across (all) platforms.
Example (the echo statement should print 0 if C:\Windows exists):
call system("dir c:\windows")
echo v:shell_error
You could maybe use some autohotkey script of this kind:
Loop {
WinWait, my command window title
WinHide
}
I was trying to use git-bash as my shell from vim on Windows but having the command prompt open whenever a command was run, as you described. My eventual solution was to install the plugin xolox/vim-shell and add the following snippet to .vimrc:
if has('win32')
set shell=bash\ -c
set shellcmdflag=
set shellxquote='
set shellquote=
set shellredir=>
set noshelltemp "This prevents an external window from opening.
endif
This utility will also do the job:
http://www.ntwind.com/software/utilities/hstart.html

Resources