Kill a process from the command line in Windows

You can kill (end, terminate) a process (task, program, application) in Windows in a way that is similar to the way it is done in Linux.

Start cmd.exe, e.g.:

  • Start -> Run -> cmd

In the terminal window that pops up at the prompt type:

  • tasklist

Look for the PID of the process you want to terminate and use the following command to ask it nicely to quit:

  • taskkill /PID <your PID here>

If you were lucky, the process will terminate. If it doesn’t, use force:

  • taskkill /PID <your PID here> /F 
Advertisements

Run a process in VirtualBox from outside

You can launch a program within an Oracle VirtualBox virtual machine from the host system’s command prompt.

Example 1:  Run notepad in MS Windows 7 virtual machine named “7” as user “user” with password “1” from Ubuntu:

  • VBoxManage guestcontrol "7" run --exe "C:\\Windows\\notepad.exe" --username user --password 1

Example 2: Output guest network info:

  • VBoxManage --nologo guestcontrol "7" run --exe "c:\\windows\\system32\\ipconfig.exe" --username user --password 1 --wait-stdout

Notes:

  • You must have Guest Additions installed
  • The user account must have a password

Input line is too long

So you create a .bat file with a long list of arguments and it fails with a message:

“the input line is too long”

To avoid this, split your long single line into multitude of shorter lines separated by the caret character to mark the line break. Like this:

echo 1^
 2^
 3

 


Windows 10 icon PNG

A 48×48 pixel PNG icon for use with Linux desktops.

Can be used to start a virtual machine with MS Windows 10 inside.

Windows 10 icon, PNG, 48x48 pixels

Windows 10 icon, PNG, 48×48 pixels


Get Windows XP network information on command line

To display or set Windows XP network parameters (IP address, default gateway, DNS servers used, routing etc.) from the command line use netsh utility.

To see the list of options type:

  • netsh /?

Access denied in SAMBA with symlinks

Problem:

SAMBA clients attempt to access symbolic links pointing to directories outside of the particular share, but get “Access is denied” error.

Cause:

By default SAMBA now does not allow such symbolic links for safety reasons.

Solution:

Add these two lines to your smb.conf

wide links = yes
unix extensions = no

The first one enables full symlink support, the other one disables an option conflicting with it.


Skip creating Microsoft account in Windows 8.1

You may feel that Microsoft is forcing you into signing up for a Microsoft account and sharing your data in order to be able to activate Windows 8.1.

Everything in the setup screens seems to be made to lure the user into signing up with Microsoft.

But actually there is an alternative for the old good local user account, only that this option is hidden well enough in the small print several screens down, too far away for the average user to even notice it’s there.

  • When you see “Next you’ll set up your account” and then “Sign in to your Microsoft account”, select “Create a new account”.
  • Then, at the screen “Create a Microsoft account” select “Sign in without a Microsoft account”.
  • Configure a normal local user account in the old fashioned way.

Some bells and whistles of the Windows may lack functionality, but its up to you to decide if you need them.

Anyway, you can create a Microsoft account later, if you decide that you need one.