Question: I'm trying to write a batch that checks how many instances of the process "example.exe" are running, and if there are two or more instances, leave it running. But if there is only one instance running, end the process. Here's what I have:

```
@echo off
wmic process where name="example.exe" | find "example" /c > %temp%\variable.txt
set /p value=<%temp%\variable.txt
if %value% lss 2 goto endprocess
if %value% gtr 1 goto continue
:endprocess
start taskkill /f /im example.exe
:continue
ECHO continue
@echo off

```

My issue is this: It always thinks value is lss 2 (it thinks there are less than 2 instances of the process running). However, in my task manager, I can see that there is obviously 2 instances running. I think it's an issue with defining the value maybe? I don't know, I'm quite new to this. Any help? Thanks!

UPDATE

Okay I've now changed it to this (suggested by Magoo)

```
@echo off
wmic process where name="example.exe" | find "example" /c > "%temp%\variable.txt"
set /p value=<"%temp%\variable.txt"
if %value% equ 1 goto endprocess
if %value% neq 1 goto continue
:endprocess
start taskkill /f /im example.exe
:continue
ECHO continue
@echo off

```

This still doesn't exactly work, but i changed the number of instances from 1 to 0 and it ended the process. In other words, 1 process was running, but this batch file thought that 0 were running. Any ideas now?

Answer: 
Nothing in Django says that a view has to render a template. That's just one of many things a view can do. A view simply needs to return an [HttpResponse](https://docs.djangoproject.com/en/3.2/ref/request-response/#django.http.HttpResponse).

Whether that HttpResponse body contains HTML, etc, is completely up to you. You also don't need a form to post data to your server. You can send any arbitrary data you need simply using JavaScript. You can still use form elements like input, textarea, etc; they don't have to be contained in a form element to be valid.

To make a long answer short, you need to use JavaScript to send data to your Django application via ajax, process the data, and return a response in JSON or XML format, which you can then use to update your page, etc. You can write vanilla JavaScript to do this, or leverage a library like [jQuery](http://jquery.com/), or if you're really, really lazy, you can use something like [Dajax](http://www.dajaxproject.com/).
As I said in my previous answer to you, the normal way of doing this in Django is to post to the same view, which accepts the data and then either re-renders the same template (eg to show errors) or redirects to another URL.

Another approach would be to do the post with Ajax.