Click to See Complete Forum and Search --> : Uptime for windows
cgkanchi
March 27th, 2003, 04:16 PM
Here's a version of uptime that I wrote for windows. The zip contains the executable and the the source. You probably need VC to compile the source without any modifications.
Cheers,
cgkanchi
Edit: Thanks to Eastwood for telling me about the GetTickCount() function.
AciDriveHB
March 27th, 2003, 04:51 PM
That's cool, I always wanted something like that in Windows 95/98, and I was happy to see that they finally built it into Windows 2000/XP. But that's cool you wrote your own, to be run from the command prompt! LOL Harcore linux user? ;-)
phishphreek
March 27th, 2003, 05:16 PM
That's cool, I always wanted something like that in Windows 95/98
I think I set a record for the Win98 uptime. I think it was somewhere around 28min 32sec or so. ;)
Thanx cgkanchi!
CXGJarrod
March 27th, 2003, 05:31 PM
Uptime: 2 days 21 hours and 2931 minutes? Any ideas why it would not convert the minutes to hours and days? I am on a Win 2k box.
Cool program though...
Maverick811
March 27th, 2003, 05:42 PM
Originally posted here (http://www.AntiOnline.com/showthread.php?threadid=#post) by phishphreek80
I think I set a record for the Win98 uptime. I think it was somewhere around 28min 32sec or so. ;)
Thanx cgkanchi!
LOL at phishphreek80! I'm thinking I can beat you - I might be able to squeak 30 minutes out of Windows!
I'd be interested to see the longest uptime of Windows ME - if it's more than 5 minutes, I'd be surprised..
Anyway, that's a pretty nifty little utility cgkanchi... Thanks..
ammo
March 27th, 2003, 05:52 PM
FYI, there is a "uptime" util in the nt/2k reskit. Of course coding your own's always nicer ;)
Ammo
cgkanchi
March 27th, 2003, 06:20 PM
But you do have to buy the ResKit don't you? If you don't then I'm wasting my time coding ps and kill replacements for 2K/XP.
Cheers,
cgkanchi
gore
March 27th, 2003, 06:36 PM
in Windows 98 SE, i had a buncha stuff loaded and i was using AIM to tell how long i was on because i didnt really know when i had signed on, but anyway, when i jad Windows 98 SE, i had 2 days of uptime, i think thats my record for that, hmmm, for Linux, i meassure that in weeks.
noODle
March 27th, 2003, 07:14 PM
Originaly taken from this file:
#!/e:/perl/bin/perl -w
$^O eq "MSWin32" || die "Limited to Windows for now\n";
use Win32;
$time = Win32::GetTickCount();
$day = int($time/86400000);
$hour = int(($time-($day*86400000))/3600000);
$min = int(($time-($hour*3600000))/60000);
$sec = int(($time-($min*60000))/1000);
print "$day days $hour hours $min minutes $sec seconds\n";
Once I tried to incorporate it into:
#!/e:/bin/perl -w
# Messagebox in perl
# Showing Username
# Computername
# Domain logged into
# IP
# Localtime
# And uptime
$^O eq "MSWin32" || die "Not using Windows !";
use Win32;
use Socket; # Should I?
# get credentials
$name=Win32::LoginName();
$comp=Win32::NodeName();
$domain=Win32::DomainName();
if ($comp eq $domain){$login="local";}
else {$login="to the network";}
$ip_get=gethostbyname("$comp");
$ip=inet_ntoa($ip_get);
# create string from credentials
$cred="Login name : $name\nBox name : $comp\nDomain name : $domain\nLogged in $login\nIP : $ip\n";
# getting the time
($sec,$min,$hour)=localtime;
$local="Local time : $hour:$min:$sec";
$tick=Win32::GetTickCount();
$day=int($tick/86400000);
$hour=int(($tick-($day*86400000))/3600000);
$min=($tick-(($hour*360000))/60000);
$up="Uptime: $day days $hour hours and $min minutes";
$time= "$local\n$up\n";
# creating final string
$string="$cred$time";
# now for the creation of a message box
Win32::MsgBox("$string",48,'LOCAL INFO');
I started experiencing time problems to.
Sorry for the stupid smile in the middle.
Did't know how to get rid of it.
EDIT
got rid of it thanks to tiger_shark
Tiger Shark
March 27th, 2003, 07:50 PM
The stupid smile is because you have a : and a D right next to eachother in the text. You can separate them by a space or as you are writing the reply there is a checkbox below that says "turn off smiles in this post". Check it and all would be well.
phishphreek
March 27th, 2003, 08:13 PM
But you do have to buy the ResKit don't you?
yes, you have to buy the book and you get a companion cd.
You can get some* of them for free though. There are over 300 tools on the cd.
m$ makes about 75 or so of these tools available for free. Visit this site (http://www.microsoft.com/windows2000/techinfo/reskit/tools/) for the free ones.
PuReExcTacy
March 27th, 2003, 08:17 PM
Nice tool and everything, but what's the whole deal about trying to get uptime info on a M$ box, it doesn't stay up long enough for you to forget your last reboot. Even when you don't touch the keyboard, you'll eventually end up with that nasty Blue Screen of Death!
PuRe
mohaughn
March 27th, 2003, 08:58 PM
This is the type of output you get from the reskit tool.
Since 1/25/2003:
System Availability: 99.9653%
Total Uptime: 61d 9h:53m:13s
Total Downtime: 0d 0h:30m:40s
Total Reboots: 6
Mean Time Between Reboots: 10.24 days
Total Bluescreens: 0
This output is from one of the servers that I manage. Was just the first one that I grabbed, but I'm pretty sure most of those reboots are maintenance related as we have not had any any unscheduled service interruptions recently. My desktop has been up 141 days. The reboot before that was to install W2k SP3.. So just goes to prove that W2K systems can have long uptimes.
KissCool
March 27th, 2003, 09:29 PM
My very personal evaluation of uptimes on windows:
95: 20 min
98: 35 min
98SE: 28 min (ME problems start here)
C8H10N4O2: long, very long. But it's an experimental version.
ME: 5 min, but even an uptime program can't work properly on it.
2000: 3 weeks (ahh)
XP: 2 weeks (not too bad)
3.1: eternity!!
Well, where did I put my 3.1's installation floppies. I have just realised I should change my M$ OS.
The day when games will be perfectly supported on Linux, I will definitely get rid of my M$ partition and I will be able to speak about months or years of uptime. What frighten me is that I heard exactly the same thing from a friends 5 years ago about Mac!
KC
neel
March 27th, 2003, 11:46 PM
My windows 98 had 3 months, then I had to reboot because of a patch, no crash hang reboot or whatever in that time. Now it's on for a new record, already running for 1 month. I never tried win 95 for a record, but I once played a game for 5 hours non-stop, so that would be the record I guess. Ms-dos never crashed on me. Win ME I won't cover :s. Win 2000 lasted 1 week, but I got tired of it so I switched back to linux. My openBSD box was up for a year when it got hit by lightning.
I measured the uptime of the windows 98 box without any programm though... there's a function or whatever that keeps tracks of the seconds your system is running. I'll have to search were it comes from I guess ;).
Tedob1
March 28th, 2003, 01:51 AM
very cool tool thanks for source. put an input statement at the end to keep it open, put the exe in the path and it can be call from the run command.
in windows 98 accessories>>system tool>>system information will give you the up time.
Vigge
March 28th, 2003, 02:35 AM
Funny:
GetTickCount returns the number of milliseconds since bootup as a 32-bit unsigned integer. This makes the maximum amount of time it can count 49 days, 17 hours, 2 minutes and 47 seconds.
I guess they didnt aim for stability afterall, and they probably didnt think anyone could keep their box up longer that that?
Very lolish.
noODle
March 28th, 2003, 07:10 AM
www.byteandswitch.com reboots after two years
Last month we pointed out a Windows 2000 site that had gone over two years without a reboot.
Unfortunately, www.byteandswitch.com's proud run came to an end coinciding with the SQL-Slammer worm at the end of January.
http://news.netcraft.com/
cgkanchi
March 28th, 2003, 08:09 AM
Here's a better alternative to my tool, especially since I'm not going to fix the bug, as SoggyBottom has given me a much better alternative.
http://www.antionline.com/showthread.php?s=&threadid=241809
Cheers,
cgkanchi
GPF
March 28th, 2003, 01:12 PM
Originally posted here (http://www.AntiOnline.com/showthread.php?threadid=#post) by Tiger Shark
War: God's way of teaching Americans Geograpy
Off topic, I know:spank: , but I just think that tagline is brilliant
drew
March 28th, 2003, 01:29 PM
can't u just check the task manager? it should work for win xp at least not sure bout 95/98
cheyenne1212
September 19th, 2003, 09:20 PM
/me is wondering who bumped up this thread???
But while its bumped
Windows XP home
Uptime 8 days 22 hours and 20 minutes
antionline.com
Copyright 2007 Jupitermedia Corporation All Rights Reserved.