Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8088767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:11:01+00:00 2026-06-05T19:11:01+00:00

My minecraft server tends to crash fairly often so I wrote a script that

  • 0

My minecraft server tends to crash fairly often so I wrote a script that checks my minecraft server, if its up it does nothing, if it is down it executes this code:

Set oShell= CreateObject("WScript.Shell") 
strProcess = "cmd.exe" 
oShell.Run "TaskKill /im " & strProcess & " /f /t", , True
WScript.sleep 1000
oShell.Run "c:\minecraft_launch.bat"
Set oShell = Nothing 

Basically I kill any currently running server (cmd since it is being run from a batch file) then I start it back up. This check is run every 5mins via task scheduler.

This is the contents of the batch file:

@echo off
"C:\Program Files\Java\jre6\bin\java.exe" -Xmx1024M -Xms1024M -jar "%appdata%\- minecraft_server\minecraft_server.jar" >> "%appdata%\- minecraft_server\s.log"

When I run it, it works. Everytime, but…..When it runs automatically, it stops working. I don’t know how many times it will work until it quits. What happens is I notice it is down, so I check my computer. No server running, no process running, no javaw.exe or cmd.exe running. Nothing, but when I try to start the server it won’t start. I have to reboot the whole machine to get the server to start. I think I am missing something stupid simple here. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T19:11:02+00:00Added an answer on June 5, 2026 at 7:11 pm

    The problem could be that the timeout is too short so you try to start it while it’s still being closed. In any way, vbscript itself can check and terminate processes with more controll. See http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/processes/ for short scripts that monitor and stop processes.
    Here a script from Rob Van der woude which usually are reliable, this monitors outlook.exe so i guess you would be monitoring javaw.exe

    KillProc "outlook.exe"
    
    Sub KillProc( myProcess )
    'Authors: Denis St-Pierre and Rob van der Woude
    'Purpose: Kills a process and waits until it is truly dead
    
        Dim blnRunning, colProcesses, objProcess
        blnRunning = False
    
        Set colProcesses = GetObject( _
                           "winmgmts:{impersonationLevel=impersonate}" _
                           ).ExecQuery( "Select * From Win32_Process", , 48 )
        For Each objProcess in colProcesses
            If LCase( myProcess ) = LCase( objProcess.Name ) Then
                ' Confirm that the process was actually running
                blnRunning = True
                ' Get exact case for the actual process name
                myProcess  = objProcess.Name
                ' Kill all instances of the process
                objProcess.Terminate()
            End If
        Next
    
        If blnRunning Then
            ' Wait and make sure the process is terminated.
            ' Routine written by Denis St-Pierre.
            Do Until Not blnRunning
                Set colProcesses = GetObject( _
                                   "winmgmts:{impersonationLevel=impersonate}" _
                                   ).ExecQuery( "Select * From Win32_Process Where Name = '" _
                                 & myProcess & "'" )
                WScript.Sleep 100 'Wait for 100 MilliSeconds
                If colProcesses.Count = 0 Then 'If no more processes are running, exit loop
                    blnRunning = False
                End If
            Loop
            ' Display a message
            WScript.Echo myProcess & " was terminated"
        Else
            WScript.Echo "Process """ & myProcess & """ not found"
        End If
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I heard that minecraft server is very leaky, can consume a lot of resources
I have a script that connects to a mine craft server, receives packets, and
I'm using a crontab to run a maintenance script for my minecraft server. Most
I am writing an application (a server wrapper for Minecraft) that I wish to
I'm creating a wrapper for a Minecraft Server that is supposed to take new
background: My friend has a minecraft server with a white list. The community for
It may sound a bit weird, but in Bukkit (Minecraft Server) there's a permissions
In 3d terrain that consists of thousands of cubes (i.e. Minecraft ), what is
Background: I'm running a Minecraft server for friends on a VPS, and I'm attempting
I'm have an issue with running the built in Python server that comes with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.