-
March 27th, 2003, 05:16 PM
#1
Uptime for windows
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.
-
March 27th, 2003, 05:51 PM
#2
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? ;-)
[shadow]There is no right and wrong, only fun and boring...
Formatting my server because someone hacked into it sounds pretty boring to me...
That\'s why it\'s all about AntiOnline.com![/shadow]
-
March 27th, 2003, 06:16 PM
#3
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!
-
March 27th, 2003, 06:31 PM
#4
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...
N00b> STFU i r teh 1337 (english: You must be mistaken, good sir or madam. I believe myself to be quite a good player. On an unrelated matter, I also apparently enjoy math.)
-
March 27th, 2003, 06:42 PM
#5
Originally posted here 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..
-
March 27th, 2003, 06:52 PM
#6
FYI, there is a "uptime" util in the nt/2k reskit. Of course coding your own's always nicer
Ammo
Credit travels up, blame travels down -- The Boss
-
March 27th, 2003, 07:20 PM
#7
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
-
March 27th, 2003, 07:36 PM
#8
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.
-
March 27th, 2003, 08:14 PM
#9
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
-
March 27th, 2003, 08:50 PM
#10
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.
Don\'t SYN us.... We\'ll SYN you.....
\"A nation that draws too broad a difference between its scholars and its warriors will have its thinking done by cowards, and its fighting done by fools.\" - Thucydides
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|