Monthly Archives: February 2013

Dealing with Windows 7 Time Sync issues

For reasons (I suspect the CMOS battery, but have no replacements), the clock on my Windows 7 PC ceased working correctly. On boot, the time is very close to the time the computer was last shut down, which is often greater than 12hrs behind. It does not automatically pick up the correct time.

I initially thought that this was because there are limits to the maximum time difference when syncing, so that if the clock is too far out the system time is not updated. I tried overriding these limits in the registry, however as the default sync only runs once a week this isn’t a complete fix. My temporary solution (until a new battery is obtained) is to also set up a resync Schedule Task for each boot.

Step 1. Overriding the registry sync limits

  1. Open Regedit.
  2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config.
  3. Change MaxNegPhaseCorrection and MaxPosPhaseCorrection from d2f0 to ffffffff.
  4. Reboot.

Step 2. Setting up the Scheduled Task

  1. Open Task Scheduler.
  2. In the left panel find and highlight Task Scheduler (local) > Task Scheduler Library > Microsoft > Windows > Time Synchronization.
  3. In the Actions panel (right side) click Create Task….
  4. Enter a Name, e.g. Force sync time.
  5. Click Change User or Group….
  6. Click Advanced….
  7. Click Find Now.
  8. In the Search results list select LOCAL SERVICE., then click Ok and Ok.
  9. Tick Run with highest privileges.
  10. In Configure for select your operating system (why this doesn’t default to Windows 7 I don’t know).
  11. Activate the Triggers tab.
  12. Click New….
  13. Enter how often the Task should run. I set it to: At Startup with 1 minute delay. (I tried without a delay, and it seemed to try to update before the network was up and fail).
  14. Activate the Actions tab.
  15. Click New….
  16. Leave Action as Start a program.
  17. In Program/script enter %windir%\system32\sc.exe. In Add arguments enter start w32time task_started. This ensures the Windows time sync service is running.
  18. Click Ok.
  19. Click New… again, but this time enter a new Start a program with Program/script of %windir%\system32\w32tm.exe with and argument /resync. This synchronises the time.
  20. Activate the Conditions tab.
  21. Tick Start only if the following network connection is available, and leave it set to Any connection (as you need a network connection to synchronise the time). Optionally you can also untick the 1st Power option, as the Task won’t use much  power when using battery.
  22. Activate the Settings tab.
  23. Tick Run task as soon as possible after a scheduled start is missed.
  24. Click Ok.

You can now test the Task by clicking Run. If you clock time was incorrect, it should now be correct.

If the clock issue is that it loses time while running, this could indicate more than a battery problem. A quick fix would be to set up a Scheduled Task as above, but set it to run constantly such as every 15 min.

Undoing the changes

You can easily undo the changes above, by setting the Registry values back to the original values and deleting the Scheduled Task.

RoboHelp 7 webhelp does not work in Chrome

The RoboHelp 7 webhelp output is hard coded to check what browser you are using (don’t get me started on this, I hate user agent checks being used to disable functionality). As RH7 predates Chrome, webhelp doesn’t work. Specifically, the Table of Contents (ToC), Index, Glossary and Search does not load.

You can resolve this by editing the whver.js file in the output. The one downside is that this file is regenerated on each build. If you use software to sync the output files to a server you should be able to exclude whver.js from being updated when uploaded new builds.

3 changes to the whver.js file are needed:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
// WebHelp 5.10.006
var gbNav=false;
var gbNav6=false;
var gbNav61=false;
var gbNav7=false;
var gbNav4=false;
var gbIE4=false;
var gbIE=false;
var gbIE5=false;
var gbIE55=false;
var gbOpera6=false;
var gbOpera7=false;
var gbKonqueror3=false;
var gbSafari3=false;
var gbChrome = false ;
 
var gAgent=navigator.userAgent.toLowerCase();
var gbMac=(gAgent.indexOf("mac")!=-1);
var gbSunOS=(gAgent.indexOf("sunos")!=-1);
var gbUnixOS=(gAgent.indexOf("linux")!=-1) || (gAgent.indexOf("unix")!=-1);
var gbOpera=(gAgent.indexOf("opera")!=-1);
var gbKonqueror=(gAgent.indexOf("konqueror")!= -1);
var gbSafari=(gAgent.indexOf("safari")!= -1);
var gbWindows=((gAgent.indexOf('win')!= -1)||(gAgent.indexOf('16bit')!= -1));
var gbMozilla=((gAgent.indexOf('gecko')!=-1) && (gAgent.indexOf('netscape')==-1));
var gbChrome=(gAgent.indexOf("chrome")!=-1);
 
var gVersion=navigator.appVersion.toLowerCase();
 
var gnVerMajor=parseInt(gVersion);
var gnVerMinor=parseFloat(gVersion);
 
if(!gbOpera&&!gbKonqueror&&!gbSafari) // opera can mimic IE or Netscape by settings.
{
gbIE=(navigator.appName.indexOf("Microsoft")!=-1);
gbNav=(gAgent.indexOf('mozilla')!=-1) && ((gAgent.indexOf('spoofer')==-1) && (gAgent.indexOf('compatible')==-1));
if(gnVerMajor>=4)
{
if(navigator.appName=="Netscape")
{
gbNav4=true;
if(gnVerMajor>=5)
gbNav6=true;
}
gbIE4=(navigator.appName.indexOf("Microsoft")!=-1);
}
if(gbNav6)
{
var nPos=gAgent.indexOf("gecko");
if(nPos!=-1)
{
var nPos2=gAgent.indexOf("/", nPos);
if(nPos2!=-1)
{
var nVersion=parseFloat(gAgent.substring(nPos2+1));
if(nVersion>=20010726)
{
gbNav61=true;
if (nVersion>=20020823)
gbNav7=true;
}
}
}
}else if(gbIE4)
{
var nPos=gAgent.indexOf("msie");
if(nPos!=-1)
{
var nVersion=parseFloat(gAgent.substring(nPos+5));
if(nVersion>=5)
{
gbIE5=true;
if(nVersion>=5.5)
gbIE55=true;
}
}
}
}
else if (gbOpera)
{
var nPos = gAgent.indexOf("opera");
if(nPos!=-1)
{
var nVersion=parseFloat(gAgent.substring(nPos+6));
if(nVersion>=6)
{
gbOpera6=true;
if(nVersion>=7)
gbOpera7=true;
}
}
}
else if (gbKonqueror)
{
var nPos = gAgent.indexOf("konqueror");
if(nPos!=-1)
{
var nVersion = parseFloat(gAgent.substring(nPos+10));
if (nVersion >= 3)
{
gbKonqueror3=true;
}
}
}
if(gbSafari)
{
var nPos = gAgent.indexOf("version/");
if(nPos!=-1)
{
var nVersion = parseFloat(gAgent.substring(nPos+8,nPos+9));
if (nVersion >= 3)
{
gbSafari3=true;
}
}
}
if (gbChrome)
{
gbSafari = true ;
gbSafari3=true;
}
 
var gbWhVer=true;

Computer won’t boot due to CD/DVD in drive

This has happened to me on 2 different systems (Macbook and Windows desktop PC), and I couldn’t find any useful information online. Maybe this will help someone avoid the trial-and-error testing I had to do.

Symptoms

Computer doesn’t boot, doesn’t even get to BIOS screen. No error indications. On Macbook, none of the startup key combinations did anything.

Cause

Disc in CD/DVD drive… seriously. Was a written DVD in the Macbook, and a music CD on the PC.

Haven’t got a clue why these particular discs in these particular computers caused them to seemingly freeze during the boot process, have never seen the issue before.

Resolution

Remove the discs, problem solved. This was not quite so simple a process with the Macbook however.

Macbooks don’t have the ‘paperclip manual ejection hole’ thingy that seems to be standard on every other CD drive. Possibly this was left out as it ruined the sleek design of the Macbook :rolleyes:

However, when the case over the DVD drive flexes it touches the spinning disc and you can hear the disc rubbing (you usually notice this if you pick up the Macbook while it is accessing a disc). If you squeeze hard enough the disc stops spinning, the Macbook automatically ejects it out and the boot process continues.

Hooray!