Flam3rboy
Flam3rboy

Reputation: 105

Windows ssh - How to keep proccess running after Disconnect

I want to start a java Process(Minecraft Server) over SSH(PHP Script). And on disconnect it should not be closed.

I am using Bitvise SSH Server for Windows and 64 Bit Java. I can start the server but if I disconnect from the ssh server then the java Process(Minecraft server) stops. I tried with PUTTY but same Problem.

Is there a command for cmd, like screen for Linux, which puts a process in the background?

Thanks.

Upvotes: 6

Views: 11093

Answers (3)

Harel Ashwal
Harel Ashwal

Reputation: 1681

I'm using OpenSSH server for windows. Managed to get it working using this Power shell command:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe Invoke-WmiMethod -Class Win32_Process -Name Create -ArgumentList C:\path\your-command.exe

Upvotes: 7

BeechWood
BeechWood

Reputation: 11

If you have GNU Coreutils/cygwin installed then you can run start nohup your-command > logfile.txt and it should remain running when you exit the ssh session. This works with the OpenSSH server that comes with Windows 10.

Upvotes: 0

iBug
iBug

Reputation: 37307

Check out this question on Super User: Windows - Run process on background after closing cmd

So what you will do is:

start javaw.exe <arguments>

This will keep the process running after you disconnect from SSH, which will close the CMD session you issued the command.

Upvotes: 0

Related Questions