start a process in "BUILD EVENTS" in visual studio

Does anyone knows how to start a process in "build events" visual studio? for example

TASKKILL /FI "IMAGENAME eq notepad.exe" /F
sleep 3
if $(ConfigurationName)==Debug @echo do some stuff of building and copyng dll files build 
C:\notepad.exe

in the last line, it get stuck and it can't finish to build dll. I try to add ampersand like linux shell to run the process but i didn't have any success.

http://ss64.com/nt/start.html

This "start" command looks promising.

"Start" background process in Task Manager, Starting a process from the command line. For example, from the shell you can type: $ program1. This instructs the shell to start a program called program1 and � This overload lets you start a process without first creating a new Process instance. The overload is an alternative to the explicit steps of creating a new Process instance, setting the FileName, Arguments, UserName, Password, and Domain properties of the StartInfo property, and calling Start for the Process instance.

If you want your post build event to finish while the application started is still running, you can use cmdow:

C:\Tools\cmdow.exe /Run C:\Windows\notepad.exe

Where C:\Tools\ is the path where you extracted the executable to.

Starting a process from the command line, This page highlights all the available ways to initiate processes in your application and details when you should consider each approach. Starting a Process from� We can start a process in PowerShell many different ways. We've got the PowerShell Start-Process and Invoke-Expression cmdlets, we can call the executable directly or use the ampersand (&) to invoke expressions. The most common way is to use Start-Process because it's probably the most intuitive. PowerShell is known for it's intuitive approach to command naming and Start-Process is an

You can do this by running your build event in an external script file.*

For example, add this to Post-build event:

powershell.exe -file "$(ProjectDir)Build\Post-build.ps1" -ConfigurationName "$(ConfigurationName)" -PlatformName "$(PlatformName)" -TargetDir "$(TargetDir)"

and create this file under project directory:

Build\Post-build.ps1

param(
    [string]$ConfigurationName,
    [string]$PlatformName,
    [string]$TargetDir
)

#[void][Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
#[void][System.Windows.Forms.MessageBox]::Show("It works.")

Get-Process Notepad | kill
Start-Sleep -seconds 1
if ($ConfigurationName -eq 'Debug')
{
    # Run some debug configuration tasks
}

Start-Process C:\notepad.exe

* Taken from this answer with some modification.

Ways to Start a Process - Appian 20.2, Starting a Process in a Control Group. Important. Some subsystems have mandatory parameters that must be set before you can move a task into a cgroup � Start.exe file information Start.exe process in Windows Task Manager. The process known as USB Stick Starter belongs to software Emsisoft Emergency Kit by Emsisoft GmbH. Description: Start.exe is not essential for Windows and will often cause problems. Start.exe is located in a subfolder of "C:\Program Files"—typically C:\Program Files

2.9. Starting a Process in a Control Group Red Hat Enterprise Linux 6, In this guide, we will explain how to start or run a Linux command or process in background and completely detach a process from its� The Start Menu process. In Windows 10 Build 1903, the Start Menu will now show up as a process called Start in the Windows Task Manager. If this process is terminated, the Start Menu will no

How to Start Linux Command in Background and Detach Process in , To manage linux process we use commands bg, fg, top, ps, kill PID, nice, renice, To start a foreground process, you can either run it from the� using System.Diagnostics; Process.Start("process.exe"); The alternative is to use an instance of the Process class. This allows much more control over the process including scheduling, the type of the window it will run in and, most usefully for me, the ability to wait for the process to finish. using System.Diagnostics;

Linux/Unix Process Management: ps, kill, top, df, free, nice Commands, Start one or more processes, optionally as a specific user. Syntax Start-Process [- FilePath] string [[-ArgumentList] string[]] [-Credential PSCredential]� Synonyms for process at Thesaurus.com with free online thesaurus, antonyms, and definitions. Find descriptive alternatives for process.

Comments
  • "start" command line doesn't work. the entire post build events get stuck.