AutoHotkey Community

It is currently May 26th, 2012, 12:29 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: December 11th, 2008, 6:26 pm 
Offline

Joined: July 25th, 2006, 7:37 pm
Posts: 490
Location: Midwest, USA
For reference sake, in Windows XP Pro SP3 running systeminfo from the cmd prompt gives the following:

Host Name: WS07
OS Name: Microsoft Windows XP Professional
OS Version: 5.1.2600 Service Pack 3 Build 2600
OS Manufacturer: Microsoft Corporation
OS Configuration: Member Workstation
OS Build Type: Multiprocessor Free
Registered Owner: My Company
Registered Organization:
Product ID: XXXXX-OEM-XXXXXXX-XXXXX
Original Install Date: 7/11/2005, 2:11:03 PM
System Up Time: 1 Days, 22 Hours, 0 Minutes, 11 Seconds
etc...etc...

Good luck!

_________________
SilverEdge78


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 12th, 2008, 12:32 am 
Offline

Joined: April 18th, 2008, 7:57 am
Posts: 1390
Location: The Interwebs
Darn, I would really like to see my system's uptime ): Must be around here somewhere..!

Edit: Just noticed it can be viewed through the 'Performance' tab of the Task Manager. But that is only the up time since the system was turned on, like A_TickCount; (systeminfo seems to display the same on XP) the OP is looking for total time it has been on since it was first installed.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 12th, 2008, 1:04 am 
Offline

Joined: July 25th, 2006, 7:37 pm
Posts: 490
Location: Midwest, USA
Um...I doubt there is anything in Windows itself that would do that. You could have your script write to the registry as previously suggested every 15 minutes perhaps and update it.

Ie:

Read registry value
Add 15 mins to it
Write registry value

I would use a SetTimer for that and run it every 15/30/60 minutes or so.

_________________
SilverEdge78


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 12th, 2008, 2:55 pm 
Offline

Joined: November 6th, 2006, 4:18 pm
Posts: 39
Location: Sechelt,BC
Can you show me how.
Win xp
Thanks redd


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 12th, 2008, 5:10 pm 
Offline

Joined: July 25th, 2006, 7:37 pm
Posts: 490
Location: Midwest, USA
Perhaps try:

Code:
#SingleInstance Force
#Persistent


SetTimer, aa, 60000 ;updates every 1 minute
Return

aa:
  IniRead, OutputVar, C:\Temp\myfile.ini, section1, key

If OutputVar Is Numeric
  MsgBox, Debug: OutputVar is numeric and = %OutputVar%
Else
  MsgBox, Debug: OutputVar is NOT numberic thus not allowing the next command to work.  It = %OutputVar%


  OutputVar++
  IniWrite, %OutputVar%, C:\Temp\myfile.ini, section1, key
Return

F1::
  IniRead, OutputVar, C:\Temp\myfile.ini, section1, key
  MsgBox, %OutputVar% mins
Return


The orange might help you debug it better. I would also look at the Ini file to see a) if it is created in the first place b) if the value is in there with the correct section and key name c) if it updates after the IniWrite.

I would definitely add in the #Persistent and the Return after the SetTimer. This is not tested. Good luck.

_________________
SilverEdge78


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 12th, 2008, 7:51 pm 
Offline

Joined: November 6th, 2006, 4:18 pm
Posts: 39
Location: Sechelt,BC
I got It thanks for all Help
Redd


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 13th, 2008, 3:12 am 
Offline

Joined: November 6th, 2006, 4:18 pm
Posts: 39
Location: Sechelt,BC
I would like msgbox to be in hours
Thanks

SetTimer, aa, 60000 ; updates every 1 minute
aa:
IniRead, OutputVar, C:\Temp\myfile.ini, section1, key, 0 ; If no value is found, assume it is 0.
OutputVar++
IniWrite, %OutputVar%, C:\Temp\myfile.ini, section1, key
return

F1::
IniRead, OutputVar, C:\Temp\myfile.ini, section1, key
MsgBox, %OutputVar% mins
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 13th, 2008, 3:43 am 
simple math converting mins to hours (dividing by 60..)
please try before asking
Code:
F1::
IniRead, OutputVar, C:\Temp\myfile.ini, section1, key
OutputVar := OutputVar / 60
MsgBox, %OutputVar% hours
Return


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: Morpheus, SKAN, Yahoo [Bot] and 12 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group