winSysInfo not workin in 2k

2»

Comments

  • Make this PHP script, and see what it reports:
    <?php
    
    echo filemtime("C:/pagefile.sys");
    
    ?>
    
  • i get

    "1095450940"
  • Okay, now try this ...

    [code]<?php

    $mtime = filemtime("C:/pagefile.sys");
    $time = time();
    $uptime = $time - $mtime;

    echo "Modification time: $mtime\n";
    echo "Current time: $time\n";
    echo "Uptime in seconds: $uptime";

    ?>

    If the second number minus the first number equals the third number, everything is working fine, and you should be getting your uptime in seconds. Convert it to regular time by dividing by 60 to get minutes and then once more by 60 to get hours, and double-check it.

    If it's correct, then I don't know what could be wrong. The winSysInfo uptime code is almost exactly like that, so you've probably screwed something up in it.
  • Sorry, typo. Here's the code again:
    &lt;?php
    
    $mtime = filemtime&#40;"C:/pagefile.sys"&#41;;
    $time = time&#40;&#41;;
    $uptime = $time - $mtime;
    
    echo "Modification time: $mtime\n";
    echo "Current time: $time\n";
    echo "Uptime in seconds: $uptime";
    
    ?&gt;
    
  • PHP Script wrote:
    Modification time: 1095450940 Current time: 1095458585 Uptime in seconds: 7645
  • Your uptime should have been a little over 2 hours at that point. Is that what WinSysInfo reported, or no?
  • yes, but its rong my servers been on for about a day....
  • Uptime is generally based on the pagefile time, when it was created till what time it is now. And since you cant delete then make the pagefile during use, it should always be right.



    -FishNET
  • That's freaking odd ...

    The reason WinSysInfo uses the pagefile to measure uptime is because Windows opens a handle to that file almost as soon as you boot up, and doesn't close that handle until you shut down. As far as I know, the modification timestamp is written at the moment that it opens the file. In essence, the time you get by subtracting the current time from the time of the modification of pagefile.sys is your uptime, give or take about 30 seconds.

    It almost seems like pagefile.sys was closed/modified/opened/whatever while Windows was already booted up.

    Perhaps your pagefile is a different file? :-?
  • nope, i checked the settings and it is...

    altho ive had a load of other wierd stuff goin on, i think im gonna do a virus and spyware check......

    or maby ill just make my own info page
  • Here's another idea: Maybe the thing bluescreened 2.5 hours ago or something, and it rebooted itself, and you only THINK it's been on for two days?

    Hey, it's a possibility. :)
  • SigX for server says 1 day 4 hours
  • maby, but i would have been at the login screen tho

    maby if i tell it to watch a different file......

    EDIT: and i turned off auto-reboot, helps if u can find out why it BSoDed
  • Tom wrote:
    Hey, your right! Slash does like Linux.

    I feel sorry for him, then. I don't see why anyone would choose to make their lives suck when they have the option of using something better.
    I know the only thing...
    IBM always speaks about Linux, bashes it... but in whole he knows nothing of it.... probaply he never used it even...
  • The user and all related content has been deleted.
  • Alright, that's your idea. I use it and find it worthwhile for a serverer, but I can't use it as a desktop OS.

    -Q
  • The user and all related content has been deleted.
  • I'm sticking.

    -Q
  • Im sticking to linux too, even tho u may not like it Tom, i do.
  • The user and all related content has been deleted.
  • You're welcome!

    -Q
  • Tomchu wrote:
    Topher wrote:
    Im sticking to linux too, even tho u may not like it Tom, i do.

    Lol. And good for you. I'm glad there are others out there who are willing to take my share of the pain of using a shitty "OS".
    Yeah. Me too... Just like this...
  • ok..... now i cant get the drive info section working...
    // Disks to check 
    $disks				= array&#40;"C:"&#41;;
    

    now, if i want to add another drive surely i just put this...
    // Disks to check 
    $disks				= array&#40;"C: D:"&#41;;
    

    but it doesnt want to work, all i get is this...
    Warning: Division by zero in c:\srv\www\winsysinfo\index.php on line 127

    Warning: Division by zero in c:\srv\www\winsysinfo\index.php on line 128

    any ideas?
  • I think you need a comma.... I cant remember though.
  • The user and all related content has been deleted.
  • (y) thnx Tom
  • The user and all related content has been deleted.
Sign In or Register to comment.