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
    28
    Posts
    664
    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 [email protected]     ::
    
    :: 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  
    Extreme Donator

    sexyrussian's Avatar
    Join Date
    Nov 2009
    Posts
    887
    Thanks given
    47
    Thanks received
    23
    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
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Nov 2009
    Posts
    4,219
    Thanks given
    2,950
    Thanks received
    1,362
    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
    28
    Posts
    664
    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 [email protected]     ::
    
    :: 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!
    Infexis's Avatar
    Join Date
    Aug 2009
    Age
    28
    Posts
    4,557
    Thanks given
    1,158
    Thanks received
    1,174
    Rep Power
    2949
    Very nice done.. Will probably use this once.
    Reply With Quote  
     

  6. #6  
    Donator

    Nintendo's Avatar
    Join Date
    Oct 2008
    Posts
    1,680
    Thanks given
    195
    Thanks received
    184
    Rep Power
    231
    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  
    Banned
    Join Date
    Sep 2010
    Posts
    883
    Thanks given
    20
    Thanks received
    6
    Rep Power
    0
    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
    843
    Thanks given
    7
    Thanks received
    30
    Rep Power
    108
    Nice, even though batch coding is easy.
    Real Eyes
    Realize
    Real Lies
    Reply With Quote  
     

  10. #10  
    q.q


    Join Date
    Dec 2010
    Posts
    6,519
    Thanks given
    1,072
    Thanks received
    3,535
    Rep Power
    4752
    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)


User Tag List

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