www.delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
X-SWARE-Spam-Status: | No, hits=-0.8 required=5.0 tests=AWL,BAYES_40,SPF_HELO_PASS |
X-Spam-Check-By: | sourceware.org |
Message-ID: | <498870ED.1060103@veritech.com> |
Date: | Tue, 03 Feb 2009 11:29:33 -0500 |
From: | "Lee D. Rothstein" <l1ee057 AT veritech DOT com> |
User-Agent: | Thunderbird 2.0.0.19 (Windows/20081209) |
MIME-Version: | 1.0 |
To: | Cygwin Tech List <cygwin AT cygwin DOT com> |
Subject: | Solution?: Saving Dates in Cygwin/Windows with hibernating PCs |
X-Bogosity: | Ham, tests=bogofilter, spamicity=0.000003, version=1.0.1 |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
I read with interest the problems with getting good time stamps from modern PC Systems that hibernate. I've been working on a different problem, and it occurs to me that a utility of Windows can be used to solve this problem, if you don't mind doing it in a non-GNUish way. There's a console program called 'setx' that comes with Windows XP/Vista, that allows you to make a "permanent" change to the Windows System or User environment variables, as if you had used: Control Panel / System / Advanced System Settings / Advanced / Environment Variables / System Variables | User Variables / <select variable_of_interest_if_exists> / New | Edit / <enter_changes> / OK If you use 'setx' to record the boot time in a system startup script as a system environment variable, say, MYBOOTTIME, then you can use this later on, without impact of hibernate. 'setx' could be run from a 'cmd.exe' batch file placed in the 'Startup' folder, or a shell script could be invoked from that batch file that does everything that you want. If you're a stickler for the exact boot time, you could have the script look-up the system boot time, using the previously mentioned perl hacks, and then use 'setx' to store that, before hibernation could mess it up. It would appear that you could even use the difference in times between a new boot time lookup and the environment variable timestamp to determine how much hibernation time had occurred. Variations of this tack could be used to compute other times. Does this help, or am I just wasting time? ;-) Lee -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |