Uptime for windows
Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Uptime for windows

  1. #1
    Antionline Herpetologist
    Join Date
    Aug 2001
    Posts
    1,165

    Thumbs up 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.
    Buy the Snakes of India book, support research and education (sorry the website has been discontinued)
    My blog: http://biology000.blogspot.com

  2. #2
    Senior Member
    Join Date
    Jan 2003
    Posts
    686
    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]

  3. #3
    AO übergeek phishphreek's Avatar
    Join Date
    Jan 2002
    Posts
    4,325
    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!

  4. #4
    AO Decepticon CXGJarrod's Avatar
    Join Date
    Jul 2002
    Posts
    2,038
    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.)

  5. #5
    Top Gun Maverick811's Avatar
    Join Date
    Oct 2001
    Posts
    852
    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..

  6. #6
    Senior Member
    Join Date
    Sep 2001
    Posts
    1,027
    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

  7. #7
    Antionline Herpetologist
    Join Date
    Aug 2001
    Posts
    1,165
    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
    Buy the Snakes of India book, support research and education (sorry the website has been discontinued)
    My blog: http://biology000.blogspot.com

  8. #8
    Senior Member gore's Avatar
    Join Date
    Oct 2002
    Location
    Michigan
    Posts
    7,177
    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.

  9. #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

  10. #10
    AO Ancient: Team Leader
    Join Date
    Oct 2002
    Posts
    5,197
    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
  •