SyncClinet Command line Problem

Hi everybody,
I am on Windows 8.1 latest updates
Nextcloud Client 3.4.1

I recently discovered that there are some commannd line arguments available on the nextcloud client (Windows). So I wanted to use these to solve an ongoing problem I have.

Short description of what I want to use it for:
I need to modify some files viea a batch script. This script creates a temporary file and sometimes Nextcloud syncs this back and my data get corrupt becasue the process was not finished.

To work around this I just want to stop the running instance with nextcloud.exe -q, that works like charm.
But at the end of my batch file of course I want to reastrt nextcloud by calling nextcloud.exe or nextcloud.exe --background
At this point Nextcloud launches but totally interrupts the running batch file and I assume this is not how it is supposed to be.

Actual Problem description
It seems it totall crashes the process and I can’t even ctrl+c out of the batch script anymore. It seems totally stuck and I need to kill it.

If I just manually execute from the Windows Command-Line, it launches and let’s me continue with the next command. So behavior looks different.

Usually if I don’t want to wait for a program to finish and keep the batch running, I put a “start” infront of the program that I launch. That doesn’t work here either.
What happens then is: I get a new command prompt that does not launch nextcloud at all. Also not as it is supposed to behave, I guess.

Did I try to make sure it is not a problem of my batch file?
Yes Indeed, I striped down everything that is really doing stuff and left the skeleton.

::@echo off
setlocal enabledelayedexpansion
set _ver=0.0.0

set _nextcloud="C:\Program Files\Nextcloud\Nextcloud.exe"

title %~nx0 Version %_ver%
pushd %~dp0

Echo stoppe Nextcloud
%_nextcloud% -q
Echo do something
ping > NUL

goto ende

echo Fehler: Some Fancy Error Message

echo starte Nextcloud
::start %_nextcloud%
ping > NUL

Am I doing something stupidly wrong or did I found a bug?

Thanks for any help much appreciated

Maybe it works when you start it with „start“ so it’s independent of your batch file, like this: Start "" %_nextcloud%

Thank you @SysKeeper for your quick answer. Unfortunately I already tried that as well and it does not work either.

To quote myself:

Sorry @shorty.xs I obviously missed that part :sweat_smile:
Just to make sure, you had an empty string as the first parameter and the path as a second parameter as in my example? IIRC correctly, there’s a difference when supplying an empty string as the first parameter. But haven’t had time to test it with the nextcloud Client.

Well, in the original version it is not 0.0.0 It is just some version number, that is written to the Titel of the cmd window.
The behavior seems to be identical. Also there are dots between the numbers, I assume it does not create an empty parameter.

By the way I am using other command line programs in the same batch file, they works all normal. Nextcloud, just was the last addition.
In my example is striped out all that stuff, because it made no difference in the behavior of nextcloud.exe

I finally got back to this issue nad found out the root cause.

I did not use the “” after the start command. Adding them solves the problem.
I’m pretty sure I have used this comand like start application.exe may times before but for the nextcloud client it reqires the “” or I gues you could even name it lile start "Nextcloud" nextcloud.exe