Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

2008-02-18

Strange problem with file copying in Windows Explorer

Since I sometimes need to use chinese in Windows, I set up my Windows XP under "Control Panel" -> "Regional and Language Options" -> "Advanced" -> "non-Unicode Program" Encoding -> "Simplified Chinese".

Now I get a big problem. I copied a zip file from a Linux box to my local computer. The copy process was ok and the zip file could be extracted too. Then I tried to copy that zip file to a directory on a machine with windows server 2003 enterprise version using Copy/Paste. The copy process seemed normal, but when I opened the file directly on the target machine and tried to extract it, WinRar told me "the zip file is corrupt!".

If I change the non-Unicode Program's Encoding to something like "German", then the problem will not happen. It seems that the windows explorer is a non-unicode program?!

My Windows is already updated to SP2. The IE version is still version 6.

Until now I haven't find any solution to this problem.

2007-08-28

Automatic Login to google with WScript.

WScript is the short name for Windows Script. It can be a VBScript or JScript(not Javascript but a Microsoft standard!) If we use it properly, it can save us a lot of work. Here is an example for a script which can be used to login in google account automaticly.

var ie=WScript.createobject("InternetExplorer.Application");
var args = WScript.arguments;
var followme="http://www.google.com/";
if(args.length>0)
{
followme
+=args(0);
}
ie.Navigate(
"https://www.google.com/accounts/Login?continue="+followme);
SynchronizeIE();
var doc=ie.document;
doc.forms[
0].Email.value="yourName@gmail.com";
doc.forms[
0].Passwd.value="^your password";

//because the checkbox "PersistentCookie" appears randomly
if(doc.forms[0].PersistentCookie!=null)
{
doc.forms[
0].PersistentCookie.checked=false;
}
doc.forms[
0].submit();
SynchronizeIE();
ie.Visible
=true;

//wait for IE finishs its job
function SynchronizeIE()
{
while(ie.Busy)
{
WScript.Sleep(
100);
}
}

Save the code as googleSpecific.js and make it under the %windir%\system32, then create a file called google.bat under the same path with the content:

@cls

@wscript %windir%\system32\googleSpecific.js %1 %2 %3 %4 %5 %6 %7 %8 %9

After that, execute "google mail" in command promp, you can log in your gmail directly now.

Other commands are:
google notebook
google bookmarks
If you type "google" without any parameters, you will sign in with the google.com.

2007-07-09

Problem with Windows Time Update

Recently I always faced some strange problems. :-( Today I met a problem with Windows Time Update.

I tried to use the tab "Internet time" after clicking on the clock to select "Adjust Date / Time". When I selected the server "time.windows.com", then clicked "update now" on the right. Ok, error came! I got an error message "An error occurred while Windows was synchronizing with time.windows.com". Great, then I tried it with other time servers. Nothing different.

How to fix this up? Here are some steps I found in the internet.

1. Press Winkey+R, or select "Run..." from the start menu, and type "cmd" in the box;
2. After the command window shows up, type the following commands:

net stop w32time
w32tm /unregister [ignore error message]
w32tm /unregister [enter a second time]
w32tm /register
reg add hklm\system\currentcontrolset\services\w32time\parameters\ /v NtpServer /t reg_sz /d time.nist.gov /f
net start w32time


3. Try the "Internet time" update again. It should work now.