Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
.batch help
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="FirefighterKyle" data-source="post: 292462" data-attributes="member: 22469"><p>Hello I am trying to make my .bat file read off the following hours, mins and seconds in the correct term like so hours 24 = 1 day mins = 60 and sec = 60 this is the code I have and been trying to work with</p><p>[CODE]@echo off</p><p> title Server Restarter</p><p> :start</p><p> set time=36000</p><p> start notepad.exe</p><p> :loop</p><p> cls</p><p> IF %time% GTR 0 (</p><p> set /a time=%time% - 1</p><p> set /a sec=%time%/</p><p> set /a min=%time:~1%/600</p><p> set /a hr=%time:~1%/10</p><p> echo <> will Restart In %time% Seconds.</p><p> echo <> will Restart in %time% Seconds Which is %min% Minutes Which is %hr% Hours.</p><p> ping 127.0.0.1 -n 2 > NUL</p><p> goto loop</p><p> )</p><p> taskkill /f /im notepad.exe</p><p> cls</p><p> close server</p><p> goto start[/CODE]</p></blockquote><p></p>
[QUOTE="FirefighterKyle, post: 292462, member: 22469"] Hello I am trying to make my .bat file read off the following hours, mins and seconds in the correct term like so hours 24 = 1 day mins = 60 and sec = 60 this is the code I have and been trying to work with [CODE]@echo off title Server Restarter :start set time=36000 start notepad.exe :loop cls IF %time% GTR 0 ( set /a time=%time% - 1 set /a sec=%time%/ set /a min=%time:~1%/600 set /a hr=%time:~1%/10 echo <> will Restart In %time% Seconds. echo <> will Restart in %time% Seconds Which is %min% Minutes Which is %hr% Hours. ping 127.0.0.1 -n 2 > NUL goto loop ) taskkill /f /im notepad.exe cls close server goto start[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
.batch help
Top