Thread: Simple auto-restarter in batch

Page 1 of 3 123 LastLast
Results 1 to 10 of 22
  1. #1 Simple auto-restarter in batch 
    Registered Member D4NyZ's Avatar
    Join Date
    Sep 2008
    Age
    19
    Posts
    665
    Thanks given
    50
    Thanks received
    10
    Rep Power
    30
    Hello!

    Today I was a bit bored and I saw a peoples had some problems with an autorestarter(.exe) and I tried to do an auto-restarter which can be used easily. I did in 5 minutes and tested it with "notepad.exe". This should work, I'm 98% sure. Here is the code:

    Code:
    ::    Simple auto-restarter                ::
    ::            by D4NyZ@rune-server.org     ::
    
    :: CONFIGURATION
        :: time(in seconds)
            set time=10
        :: program name
            set program=notepad.exe
        :: run command(the batch command)
            set batchCommand=notepad.exe c:/test.txt
        :: this file name(the name)
            set this=autorestarter.bat
    
    :: DO NOT EDIT BELOW ONLY IF YOU KNOW WHAT ARE YOU DOING!
    :: DO NOT EDIT BELOW ONLY IF YOU KNOW WHAT ARE YOU DOING!
    :: DO NOT EDIT BELOW ONLY IF YOU KNOW WHAT ARE YOU DOING!
        :: init
        @echo off
        cls
        title Simple auto-restarter by D4NyZ
    
        echo Opening the application
        start %batchCommand%
        echo Application opened
        ping 127.0.0.1 -n %time% > nul
        echo Closing the application
        taskkill /im %program%
        echo ...
    
        :: executes this batch file again
        %this%
    Save it as autorestarter.bat and put in your server folder.
    Spoiler for Retard below:

    Quote Originally Posted by dani_gonzales View Post
    dany i know u hate me because i am better then u,,,so stfu noob and stop spaming my posts or i conntact a moderator!

    Reply With Quote  
     

  2. #2  
    Registered Member
    sexyrussian's Avatar
    Join Date
    Nov 2009
    Posts
    868
    Thanks given
    46
    Thanks received
    22
    Rep Power
    0
    eh i suck at it this is what i put
    :: CONFIGURATION
    :: time(in minutes)
    set time=60
    :: program name
    set program=runserver.bat
    :: run command(the batch command)
    set batchCommand=runserver.bat D:\Sexyscape server\bin\runserver.bat
    :: this file name(the name)
    set this=auto.bat

    :: DO NOT EDIT BELOW ONLY IF YOU KNOW WHAT ARE YOU DOING!
    :: DO NOT EDIT BELOW ONLY IF YOU KNOW WHAT ARE YOU DOING!
    :: DO NOT EDIT BELOW ONLY IF YOU KNOW WHAT ARE YOU DOING!
    :: init
    @echo off
    cls
    title Simple auto-restarter by D4NyZ

    echo Opening the application
    start %batchCommand%
    echo Application opened
    ping 127.0.0.1 -n %time% > nul
    echo Closing the application
    taskkill /im %program%
    echo ...

    :: executes this batch file again
    %this%

    and it just kept spamming windows
    Spoiler for the red wall of hate:

    Leader board:
    Santa: 8
    Scu11: 7
    everyone else has 2 or 1.
    santa has a new excuse for all 8 of his.
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Nov 2009
    Posts
    4,223
    Thanks given
    2,955
    Thanks received
    1,363
    Rep Power
    0
    Erm, what if I want to set it for every 2 hours. And what about the problem above mine?
    Reply With Quote  
     

  4. #4  
    Registered Member D4NyZ's Avatar
    Join Date
    Sep 2008
    Age
    19
    Posts
    665
    Thanks given
    50
    Thanks received
    10
    Rep Power
    30
    I edited it, wrote "minutes", not "seconds".

    Btw, it should be something like this:
    Code:
    ::    Simple auto-restarter                ::
    ::            by D4NyZ@rune-server.org     ::
    
    :: CONFIGURATION
        :: time(in seconds)
            ::2h*60min*60s=7200
            set time=7200
        :: program name
            set program=java.exe
        :: run command(the batch command)
            set batchCommand=java.exe -parameters...
        :: this file name(the name)
            set this=autorestarter.bat
    
    :: DO NOT EDIT BELOW ONLY IF YOU KNOW WHAT ARE YOU DOING!
    :: DO NOT EDIT BELOW ONLY IF YOU KNOW WHAT ARE YOU DOING!
    :: DO NOT EDIT BELOW ONLY IF YOU KNOW WHAT ARE YOU DOING!
        :: init
        @echo off
        cls
        title Simple auto-restarter by D4NyZ
    
        echo Opening the application
        start %batchCommand%
        echo Application opened
        ping 127.0.0.1 -n %time% > nul
        echo Closing the application
        taskkill /im %program%
        echo ...
    
        :: executes this batch file again
        %this%
    Spoiler for Retard below:

    Quote Originally Posted by dani_gonzales View Post
    dany i know u hate me because i am better then u,,,so stfu noob and stop spaming my posts or i conntact a moderator!

    Reply With Quote  
     

  5. #5  
    If you read this you're gay!

    Join Date
    Aug 2009
    Age
    18
    Posts
    4,383
    Thanks given
    1,052
    Thanks received
    1,115
    Rep Power
    2752
    Very nice done.. Will probably use this once.
    Reply With Quote  
     

  6. #6  
    Donator

    Nintendo's Avatar
    Join Date
    Oct 2008
    Posts
    1,667
    Thanks given
    193
    Thanks received
    184
    Rep Power
    221
    Nice.
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Dec 2010
    Posts
    30
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Wow ur so cool, thank you so fkn much for trying to crash my windows. But for your unfortunate I must say that if you really was thinking that you can crash a normal computer (which your obviously isn't, probably some windows 98 wit 16mb RAM, yayayayy!!) like that, then you're wrong. Do not download it!
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Sep 2010
    Posts
    849
    Thanks given
    2
    Thanks received
    4
    Rep Power
    22
    Does this automaticly put a ::update message in? like so everybody just doesnt dc randomly and thinks its a shit server?
    Reply With Quote  
     

  9. #9  
    Registered Member


    Join Date
    Sep 2010
    Posts
    851
    Thanks given
    6
    Thanks received
    29
    Rep Power
    108
    Nice, even though batch coding is easy. :P
    Success is my only mother fucking option, failures not.
    Reply With Quote  
     

  10. #10  
    q.q


    Join Date
    Dec 2010
    Posts
    6,250
    Thanks given
    936
    Thanks received
    3,139
    Rep Power
    3552
    Nice job, can you post a .sh version.

    Need one for my VPS would be muchely appreicated.
    Reply With Quote  
     

Page 1 of 3 123 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •