Archive
XP: kill a Windows process from the command line with taskkill | a Tech-Recipes Tutorial
XP: kill a Windows process from the command line with taskkill
The ability to perform tasks from a system’s command line allows those tasks to be used in batch files. This recipe describes several uses of taskkill to terminate Windows processes.
If you know the name of a process to kill, for example notepad.exe, use the following command from a command prompt to end it:
taskkill /IM notepad.exe
This will cause the program to terminate gracefully, asking for confirmation if there are unsaved changes. To forcefully kill the same process, add the /F option to the command line. Be careful with the /F option as it will terminate all matching processes without confirmation.
To kill a single instance of a process, specify its process id (PID). For example, if the desired process has a PID of 827, use the following command to kill it: … (Read more here)
Elangovv\’s Blog – [Batch Files and Such]
[object HTMLTextAreaElement]
via Elangovv\'s Blog.
Powershell – Executing commands which require quotes and variables is practically impossible!

Executing commands which require quotes and variables is practically impossible: Microsoft Connect
This is an interesting forum thread about what I’ve spent the last 2 hours researching: How to properly quote commands with parameters and interpolated paths so that they will execute as a command. Doesn’t seem like it should be so hard. Here is an example of the code I’m working with:
The command I’m trying to run:
C:\Program Files\Mozilla Firefox\firefox.exe -createprofile myTest
# Here is what works in MS-Dos / Windows XP command prompt:
"C:\Program Files\Mozilla Firefox\firefox.exe" -CreateProfile myTest
However, run the same thing in powershell and this is what you get:
At line:1 char:48Unexpected token ‘CreatProfile’ in expression or statement.
At line:1 char:49Unexpected token ‘myTest’ in expression or statement.
At line:1 char:62
Related articles
- PowerShell and Executables (jrich523.wordpress.com)
