Archive for July 2015

Auto Sync time for your computer

I have a very old laptop, it is out of battery for CMOS, so each time a unplug it , the time is jump back to 2002 (i guest this is its birth year :) , I had to sync its time everytime I turn it on. It’s old so it is not easy to open its components and replace the CMOS battery.

So I think, that must has some programs to sync the time for this case,right? And I googled it. But most of these programs required you to install it. I dont like this, I thought it is a very simple job, no need to install a program, just find some ones can run directly. In several hours, I could not find any tool which is small and run directly as I want. I even though that I will code one.

Luckily, I fought this very small one, which will sync your computer’time with internet time. It’s very small, does not have a UI, too. I like it.

All I need to do is quite simple: I wrote a small batch file with some commands, and put this batch file to startup folder.

At first, it has only one command:

“cmdtime3.exe” /q sync /m:7200000

It runs well, except sometime, when the LAN to internet was not ready so It could not sync time.

So I put more commands into the batch file, the idea is wait until internet connection is ready and sync after that. I use ping command to wait until internet is ok:
:start
ping -n 1 google.com
if %errorlevel% == 0 goto remote_desktop

rem wait for 10 seconds before trying again
@echo Waiting 10 seconds…
ping -n 10 127.0.0.1 > nul

rem loopback to start
goto start

And after these ones is the suync time command.

You can download all here: cmdtime

Hope this can help someone wants to find a simple and small solution. :)

 

Very Small tool to ask password without logout or switch user on Windows

When working at Vinecom, I have to join many quick meetings or sometimes , I had to go home and need run teamviewer to remote access my working computer. In both cases, I did not want to logout or switch user because some programs in running, it takes time when logining in again and teamviewer can not run remote control mode (even when you just switch user only)

So I create a small program, called Lockwin, by VB6 (not my favourite language but it has portable compiler) . This program do 2 very simple tasks:

– Display an “always on top” form, asking to input your computer ‘s password (the system password you used to login) . So no one can see any other programs running or your data

– Check if “Task manger” called, it will shutdown your computer . I assume that if “Task manager” called in this case, someone wants to close the program illegallty.

In addition, I often turn on my computer and leave it to do other things, and when I return, I login and wait for startup programs run. I feel it costs time. So I change to policy in Windows to bypass login screen at the first time to run startup programs.

But what about the security? I put Lockwin in Startup, and the problem is solved, Startup programs can run without waiting login and nobody can use my computer until I login. Perfect as I need.

The source code and program here: lockwin

Hope this help someone’s demand. :)

Follow

Get the latest posts delivered to your mailbox: