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
    17
    Posts
    667
    Thanks
    50
    Thanked 12 Times in 11 Posts
    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
    878
    Thanks
    46
    Thanked 22 Times in 16 Posts
    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:\***yscape 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,249
    Thanks
    2,959
    Thanked 1,366 Times in 821 Posts
    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
    17
    Posts
    667
    Thanks
    50
    Thanked 12 Times in 11 Posts
    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
    17
    Posts
    4,280
    Thanks
    946
    Thanked 1,023 Times in 459 Posts
    Rep Power
    2636
    Very nice done.. Will probably use this once.
    Reply With Quote  
     

  6. #6  
    Donator


    Join Date
    Oct 2008
    Posts
    1,638
    Thanks
    186
    Thanked 157 Times in 86 Posts
    Rep Power
    238
    Nice.
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Dec 2010
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    2
    Thanked 4 Times in 4 Posts
    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
    854
    Thanks
    6
    Thanked 29 Times in 25 Posts
    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  
    Donator


    Join Date
    Dec 2010
    Posts
    5,256
    Thanks
    632
    Thanked 2,112 Times in 1,134 Posts
    Rep Power
    2204
    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
  •