Wednesday, November 23, 2011

How to Open a Elevated Command Prompt in Windows 7 (Run as administrator)

1. Use a Elevated Command Prompt shortcut.

OR

2. Open the Start Menu.

3. Click on All Programs and Accessories, then right click on Command Prompt and click on Run as administrator. (see screenshot below)
Elevated Command Prompt-shortcut.jpg
OR

4. Open the Start Menu.


5. In the Start Menu search box area, type cmd and press CTRL+SHIFT+ENTER.

OR

6. Open the Start Menu.

7. In the Start Menu search box area type cmd, then right click on cmd.exe (at top), and click on Run as administrator. (see screenshot below)
Elevated Command Prompt-search_box.jpg
Tip   Tip
  • If you are in a administrator account and get a log in prompt after doing any of the above steps, then click on the Cancel button and repeat the above step again. This will only do this for the very first time you try to open a elevated command prompt in Windows 7.
  • If you are in a standard account, then you will need to type in the administrator's password to elevate the command prompt.
Elevated Command Prompt-log-.jpg





That's it,


source: http://www.sevenforums.com/tutorials/783-elevated-command-prompt.html

Win7文件关联 文件与程序“联姻”

遇到一位朋友紧急求助:系统是windows7,这位朋友因为桌面没有 OFFICE图标,又急着要用WORD,就把一个桌面图标右击,选择打开方式中选择了Word,而且没有把“始终使用这种程序打开同类型文件”前的勾去 掉。这一改之后,结果所有的快捷方式全变成了word文档了。可以再改成别的,比如再改为记事本方式打开,但就是没有办法恢复原状。

这是一个文件关联的问题。这样的问题在xp下根本就不可能发生,看来这个具体问题是Win7下的新问题。网上大致搜了一下,发现出现这样问题的决不只是这位朋友,看来有解决的必要。

为了解决这个问题,我们需要先谈一下文件关联的一些基本的知识,这样才能使朋友们做到知其然而知其所以然。

文件关联,主要的是把文件类型与开放式命令关联起来。而windows是通过文件的扩展名来识别文件类型的,这就首先需要把扩展名与文件类型关联起来。

assoc命令

要修改扩展名与文件类型的关联,我们需要用到一个命令:assoc

点开始,搜索,输入cmd,打开cmd,在cmd中输入:assoc /? 回车。我们可以得到关于这个命令的帮助。

assoc命令的作用有两个,一是显示扩展名与文件类型的关联,一是改写扩展名与文件类型的关联。

让我们以快捷方式的关联为例来讲述这个问题。

快捷方式的扩展名是.lnk,在windows下,这个扩展名一般是不会显现出来的,如果出现了,必是它的文件关联出问题了。

我们在cmd中输入:assoc .lnk ,回车后我们可以得到的命令结果是: .lnk=lnkfile 。这个命令结果显示了:扩展名.lnk与文件类型lnkfile是相关联的。凡是扩展名为.lnk的文件,都属于lnkfile这个文件类型。

现在让我们输入命令: assoc .lnk=lnk ,按下回车键,lnk这个扩展名与文件类型的关联就被改写了。然后我们再输入命令: assoc .lnk ,按下回车键,我们得到的命令结果将是: .lnk=lnk ,这个结果显示了,扩展名.lnk已经是与文件类型lnk相关联,而不再是与lnkfile相关联。

这个时候你去桌面上去看一下吧,你桌面上所有的快捷方式的后缀名.lnk全部显示出来了,所有的快捷方式都不再可用。双击时会提示:windows无法打开此文件。

现在再让我们输入: assoc .lnk=lnkfile ,按下回车键,我们将会发现,一切又恢复了原状。

总之,如果是快捷方式的扩展名与文件类型之间的关联出现了问题,我们只需要输入: assoc .lnk=lnkfile,回车后即可以解决问题。

这样,如果我们知道一种扩展名所属的正确的文件类型,当这种扩展名与文件类型之间的关联出现问题的时候,我们只需要输入: assoc .ext=filetype ,按下回车键即可。 这个.ext代表的是文件扩展名,比如.lnk,这个filetype代表的是文件类型,比如lnkfile。如果我们不知道一种扩展名所关联的文件类型 是什么,我们只需要在cmd中输入:assoc .ext回车。我们就能得到它所关联的文件类型是什么。

每一个注册了的扩展名都会在注册表中存在着一个对应的注册表项: HKEY_CLASSES_ROOT\.ext ,

这里的.ext代表的是扩展名,比如快捷方式对应的项就是: HKEY_CLASSES_ROOT\.lnk ,这个项有一个默认的值,这个默认的值的数据,就是这个快捷方式所关联的文件类型。因而assoc命令,主要的就是修改这个项的默认值的数据。但需要注意 的是,assoc命令所修改的内容,并不仅仅是这个项的默认值的数据,它还会要修改其它的一些方面。所以我们直接在注册表中改这个值的数据,并不能完全代 替assoc命令。



fytpe命令

我们现在知道了如何把扩展名与文件类型关联起来了,进一步地需要知道的是如何把文件类型与开放式命令关联起来。比如.txt扩展名所关联的文 件类型是txtfile,而txtfile正常的情形下,总是用notepad.exe(记事本)来打开的,这个notepad.exe就是打开 txtfile文件类型的开放式命令。

如何来修改这种文件类型与开放式命令之间的关联呢?这需要用到另外的一个重要的命令:ftype

让我们在cmd中输入: ftype /? 回车。我们可以得到这个命令的帮助。  

ftype命令有两个作用,一是显示文件类型与开放式命令之间的关联,一是改写文件类型与开放式命令之间的关联。  

如果我们想知道一种文件类型与什么样的开放式命令相关联,我们只需要在cmd中输入: ftype fileType ,按下回车键,我们就能够得到我们想要得到的结果。

这个fileType代表的是指定的文件类型,比如lnkfile,我们输入:ftype lnkfile ,按下回车键,正常情形下我们得到的命令结果是: 没有找到文件类型“lnkfile”或者与其相关的开放式命令,这个结果表明正常的情形下,lnkfile是没有与任何开放式命令相关联的。

让我们输入:ftype lnkfile=notepad.exe ,按下回车键,再输入:ftype lnkfile ,按下回车键,我们将得到的命令结果是: lnkfile=notepad.exe 这个结果表明了:文件类型lnkfile就与开放式命令notepad.exe关联上了。

这种情形下,仍然并不会影响快捷方式的打开。 那么,如何来清除这个关联,并且不与其它的开放式命令关联呢?我们只要输入: ftype lnkfile= ,然后回车即可。

在xp下,这个命令无效,但是,我们可以在xp下输入:ftype lnkfile= ,按下回车键,这个命令与前一个命令在外表上几乎看不出区别,区别就在于,前一个命令在=后面没有空格,而后一个命令在=后有一个空格。

让我们输入:ftype txtfile ,按下回车键,正常情形下,我们可以得到的命令结果是: txtfile="%SystemRoot%\system32\NOTEPAD.EXE" %1 ,这个结果表明了:文件类型txtfile与开放式命令txtfile="%SystemRoot%\system32\NOTEPAD.EXE" %1相关联。

如果一种文件类型与开放式命令之间的关联出现了问题,而我们知道正确的开放式命令是什么,这时我们只需要在cmd中输入如下命令并回车即可修 复: ftype fileType=openCommandString ,这里fileType代表的是指定的文件类型,比如txtfile,这里openCommandString代表的是开放式命令,比如 notepad.exe

如果我们的txtfile与开放式命令之间的关联出了问题,我们只需要在cmd中输入: ftype txtfile="%SystemRoot%\system32\NOTEPAD.EXE" %1 ,按下回车键,这样我们也就修复了txtfile文件类型与它的开放式命令之间的关联。

所谓开放式命令,其实就是对这种文件类型的打开方式。每一种注册了的文件类型,在注册表中都会存在着它的一个对应的注册表项,这个注册表项就 是: HKEY_CLASSES_ROOT\filetype ,这个filetype代表的是文件类型,比如batfile文件类型所对应的注册表项就是: HKEY_CLASSES_ROOT\batfile ,ftype命令所修改的注册表项主要就是---HKEY_CLASSES_ROOT\filetype\shell\open\command---这 个项的默认值的数据。

但需要注意的是,ftype命令所修改的并不仅仅是这个默认值的数据。因而直接在注册表中修改这个数据,并不能代替ftype命令的修改。
  当然,ftype命令所修改的全部的东西都可以在注册表中找到,但是,我们那样一一地去找,远不如用ftype命令简单修改来得爽。


右键打开方式

前面我们谈到了扩展名与文件类型的关联,文件类型与开放式命令的关联(也就是文件的打开方式),看起来好象我们关于文件关联的问题就谈完了, 实则不然,还有另外的一个重要的方面我们没有谈到。这就是我们右击一个文件,选择打开方式(并不是所有文件右键都有打开方式这个选项的),然后我们选择一 个程序,并把“始终使用这种程序打开同类型文件”前的勾选上,点确认。比如本文开头的那位朋友,把所有快捷方式都选择以word程序打开一样。这样之后, 这个文件类型也就与这个开放式命令关联起来了。

ftype命令是修改文件类型与开放式命令的关联的,而右键打开方式也可以修改文件类型与开放式命令的关联,这二者的关系是什么呢?

我们发现,ftype命令和右键打开方式,这二者所修改的注册表项是不同的。Ftype命令所修改的注册表项是: HKEY_CLASSES_ROOT\filetype ,这个filetype代表的是文件类型,比如HKEY_CLASSES_ROOT\lnkfile ,而右键打开方式所修改的主要注册表项是: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.ext ,这个.ext代表的是文件扩展名,比如: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.lnk ,按照我的理解,ftype命令所修改的内容属于系统设置,而右键打开方式所修改的内容则属于用户设置,这二者所设置的实际对象是一样的,当二者不一致的 时候,用户设置优先于系统设置。

三个注册表项

总之,文件关联所涉及到的注册表项主要是三个:

HKEY_CLASSES_ROOT\.ext

HKEY_CLASSES_ROOT\filetype
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.ext

问题解决

现在要回到我们在开头所说到的问题了。我教那位朋友首先输入:assoc .lnk ,返回的命令结果是: .lnk=lnkfile 中,这表明,扩展名.lnk与文件类型lnkfile之间的关联没有问题。 我再要他输入:ftype lnkfile ,返回的命令结果是:没有找到文件类型“lnkfile”或者与其相关的开放式命令,而这个结果是正常的,这表明,系统设置中的lnkfile与开放式命 令之间的关联也没有问题。

那么,问题只能出在用户设置中的lnkfile与开放式命令之间的关联出现了问题。 一般的情形下,右键打开方式的设置优先于ftype命令对文件关联的设置,这在xp和win7下都是一样的,但对于扩展名为.lnk的快捷方式,二者却具 有不同。在win7下,即便是对于.lnk快捷方式,也是右键打开方式的设置优先于ftype命令的设置。

找到了问题所在,我们就可以知道,对于这种快捷方式的文件关联错误,我们用assoc和ftype命令都是无法解决的。解决的办法就是:

在注册表中右键删除下面这个注册表项: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.lnk\UserChoice 这个注册表项下的值和数据(具体就是名为progid的值和它的数据),是对应右键打开方式所设置的默认打开程序的。

在删除后,重启电脑,或者重启explorer,问题完美得到解决。 除了这种解决办法,其它的解决办法暂时没有找到。

顺便说一下,在XP下,UserChoice这个注册表项是没有的。
  由于一些文件右键没有打开方式选项,在xp下,我们可以在我的电脑里面点工具----查看----文件夹选项---文件类型,这里我们可以进 行同样的设置,而在Win7下,我们可以在----控制面板---程序---默认程序----始终使用指定的程序打开此文类型---里面进行设置,xp下 设置的可选项要多得多,而Win7下则的设置则极为简明。
     
source: http://www.enet.com.cn/article/2011/0621/A20110621875243.shtml

Sunday, November 20, 2011

Enable Classic Logon Screen in Windows 7 Home Basic & Home Premium

If you want to enable the classic logon screen in Windows 7 Home/premium, you will need to modify a registry key, because Home does not include the Local Security Policy Manager.
Download registry file to enable classic logon screen in Windows 7
You can also do this manually.
1. Click on start and enter regedit.exe into the search field and click on the item that appears
2. Uncollapse the registry keys: [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System]
3. Double-click on “dontdisplaylastusername” in the right pane and then modify the value to “1″ to enable this option and hide the usernames of the last logged on users.
Or copy this into a notepad, save it with the extension .reg and execute it:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
“dontdisplaylastusername”=dword:00000001

Hide User Account In Windows 7 Home Premiums

So here is a quick guide on how to hide a user account in Windows 7.

*IMPORTANT: before preceding,  know that if you hide your only administrator account you may have a very hard time getting back into your system as an administrator or logging on at all. So proceed with caution and make sure and then double check and make sure again that you are hiding the correct account and that you are not hiding your only administrator account. With that out of the way...see below...

How to Hide a User Account in Windows 7

1) Click on the start menu and type in regedit




2) Select "regedit" from the search results and click yes at the UAC prompt.

3) In regedit navigate to:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon\

4) Right click on the Winlogon folder and select "New" and then select "Key". Note your Windows 7 install may already have these keys that we are creating, in that case you can skip the next few steps.



5) Name the new Key: SpecialAccounts

6) Right click on the new "SpecialAccounts" Key and select "New" and then "Key"

7) Name this new Key: UserList

8) Now select the newly created "UserList" Key. In the right pane right click on an open area and select "New" and then select "DWORD (32-bit Value)"




9) Name this new DWORD the exact same name as the user account that you want to hide. So if the user you wish to hide is "joe", then name this value "joe"

10) Double click on the new DWORD that you created. A new window will open, set the value to "0" (the number zero no quotes) if you want to hide the user. You can set it to "1" if you ever want to unhide the account. Once you set the value click "OK" and close Regedit

The next time you reboot your computer you should notice that the user is hidden from the welcome screen. I tested this in the 64-bit version Windows 7 professional and the 32-bit version of Windows 7 Ultimate RC.

source: http://www.michaelontech.com/2009/10/hide-user-account-in-windows-7.html

Sunday, November 13, 2011

Stock Comments (2011/11)

一。心态。想要炒好股票,必须要有良好的心态,要有赚而不喜、亏而不忧的正确态度
,不管是赚还是亏,都要及时总结经验和教训并牢记操作过程中的得与失。什么是真正
良好的心态呢?比如某只股票符合你的买点,但能涨多少你并不清楚,只能知道个大概
。买后它跌了些,这时很多人都会觉得自己买错了,内心会有一种挫败感和失望感。其
实没必要紧张,而要认真观察它运动的过程,你应该多看看它的形态,5日均线和10日
均线处于什么形态,量和量比是多少,内外盘的量是外盘大还是内盘大,一般说来,外
盘大于内盘表示主动性买进的人多于卖出的人。你还应注意在成交过程中每笔交易量的
大小,这些观察对于第二天的走势很重要。另外要多多观察分时k线中的5、15、30、60
分钟k线形态以及技术指标所处于何种状态,若感觉图形还好,第二天操作要关注它开
盘10分钟到20分钟是外盘大还是内盘大,若外盘大于内盘,走势自然较好,同时你还得
把注意力集中在现价和均价线上,如在涨升过程中感到涨升无力,你就应及时了结,如
果卖出后股价又超出了你的卖出价,千万不要后悔,只要总结自己错在哪里,这就是心
态。

二、涨幅和回落的关系。不管你的买入价是多少,它从当天的高点回落超过3%,就
应该引起注意,回落了3%以上的个股,当天走势往往不会太好,很难再创新高。但这不
是绝对的,是卖还是留,还得看个股的形态、量、量能线、量比、内外盘以及换手率,
还要看它已经涨了几天。

三、错误的理念。不少投资者有一种错误的投资理念,那就是手里持有几只或十几
只股票,却不知在这动荡的股市中要守好几只乃至十几只股票是非常困难的,更不要说
赚钱了,可以这样说,大盘向好时,你手中的股票也许有几只能赚钱,但由于你的看盘
经验和能力有限,如果突然变盘,你很难在短时间内了结手中的所有股票。其实你完全
可以把有限的精力放在一两只股票上,对其进行细心观察,符合买点就买,不符合就等
待机会,只要行情不是太坏,有很多值得投资的股票会像春笋一样冒出来。

四、止损。止损说起来很简单,但要做到恰到好处是很难的,一般来说止损要看处
于什么样的市道、个股的形态、涨升了多少、自涨升以来量的总和、换手率、每天的内
外盘变化情况以及移动均线和k线的距离。如果有经验,一般可控制在3%以内,即使错
了也能找到其他处于涨升段的个股。值得指出的是,止损和投资人的经验和心态有密切
的关系。

五、学会预测明天大盘基本走势。如果说个股是跳舞演员的话,大盘就是一个大舞
厅,舞厅里如果没人气,那些跳舞演员也会跳得很不起劲,只有几个敬业的演员在那里
热身,此时你应该坐在大厅里观看,看他们是怎样练习和热身的,当某个敬业的演员越
练越起劲并有继续练下去的意思,你就应该为其鼓掌(买进)。因为毕竟不是正式演出,
你还得防止他因为没观众人气而突然息场。

六、不要单相思。有的投资人买股票时常常会片面看待个股的涨跌,一只股票跌了
几天后,他会认为这只股跌得差不多了而买进,却不知在形态不好时它横盘几天后还会
下跌。炒股不要单方面认为它何时是底,而应学会顺势而为,找那些刚启动又有量的个
股,只看量还不够,还要看形态和量放大后其涨幅是否同步。选股是一个较为系统的工
作,它涉及到一个人的心态、看盘的经验、对个股形态的理解和把握,还有大盘所处的
位置以及量和价的关系等等。有些投资人选好的股票没敢买,怕跌,错过了第一买点,
心慌意乱匆忙去追高买入,却没注意此时的现价和均价的关系,结果追了高。有些股票
买错了又不肯认错,任其下跌,最后被迫长线投资。

七、顺势而为。顺势而为的含意就是顺着市道而为之,比如大盘刚由强势转入弱势
并破位的头几天,你别急着买入,因为你再有看盘的经验和选股的经验,在大盘刚转入
弱势时,你买入的股票有可能当天上涨,第二天
很有可能跳空补跌,那样会得不偿失。一个真正有经验的投资者是不会乱冒风险的,待
大盘下跌的风险释放差不多了时,虽然并没完全走好,由于前几天的下跌释放基本到了
一个小的阶段,这时有符合买点的个股,你可以出击一下,但一定要设好止损位。就像
游击战那样,打得赢就打,打不赢就走,保存实力是投资的首要之道。

Thursday, November 3, 2011

Android setting for battery saving

disable network time sync.
disable wifi or turn off wifi when screen is off.
install setcpu, set lower idle cpu speed.
or
set it at airline mode at night.
I found out that airline mode really saves battery.

more----------------

1. Screen Timeout

You must have noticed, whenever your Samsung Galaxy S is left idle, its display is automatically turned off. This is nothing but screen timeout. You can set the screen timeout at minimum level so the screen would never stay active for long once left idle. You can reach to this option just below the brightness option and then set the time of screen turning off in just 15 seconds when it is left idle. Just go to Applications > Settings > Sound and Display > Screen Timeout and change the time according to your convenience.

2. 2G Network Mode

3G phones eat a lot of battery while connecting to 3G networks for web connectivity. When you are not using 3G network, try to use it on 2G network mode. You can do this by pressing menu button > Settings > Wireless and network > Mobile networks and then select option for “Use only 2G networks”.

3. Use Built-in Battery Usage Screen

This is hardly known to casual Android users. There is a built-in Battery Usage Screen which exactly tells what is eating your battery. To access this screen go to Settings > About Phone > Battery use. Now you can easily check out what is killing your Samsung Galaxy S battery.

4. Limit The Brightness

Try to limit the brightness of your Samsung Galaxy S at a lower level. The brightness of Samsung galaxy S comes with automatic setting which decides the brightness of screen as per the surrounding. This settings requires the sensor on which would drain the battery. To change this setting just go to Applications > Settings > Sound and Display > Brightness Setting and then uncheck the option for “Automatic Brightness”. Now you can set the brightness to a lower level to save the battery.

5. Disable Wi-Fi/Enable Airplane Mode

Wi-Fi is considered a far better option than 3G network in terms of battery consumption but it is also a big time battery consumer. If the option of Wi-Fi is enabled your handset will keep on scanning for available Wi-Fi networks every now and then. So it is better to disable Wi-Fi when it is not required. You can do this by enabling Airplane mode. To do this head into Settings > Wireless & Networks > Airplane Mode or you can also toggle the Wi-Fi on or off with the help of widget available in your phone.

6. Disable Bluetooth

Bluetooth is required either at the time of file transfer or while using a wireless headset. Beside this there is no point to have Bluetooth running on all the time. Switching it off will probably save the battery life.

To switch it off go to Settings > Wireless & Networks > Bluetooth or you can also use the power widget to disable it.

7. Use Power Widget to Toggle Wi-Fi, Bluetooth, GPS & Screen Brightness

Just like any other Android phone Samsung Galaxy S also includes a built in Power Widget which can be used to toggle the settings on or off for Wi-Fi, Bluetooth, GPS and Screen Brightness. Long press on the background of your screen, choose widgets > select Power Control to add it to the screen. Once added you can easily toggle the on or off options for the mentioned utilities.

8. Disable Constantly Syncing App

There are certain apps which sync on a regular basis to get the updates from internet. One of them is Email application which uses Push technology. You must change its setting to sync manually which is the best option but if you want it to sync automatically then set it to sync less frequently.
To do this, open Email application and go to your email account. Choose Account Settings > Email check frequency. Change its option to something more like an hour or never. You can always refresh manually whenever you wish to read your mails.

Well this one was for email but you can do the same for other accounts like Twitter which is updated almost more frequently and is in fact less important. Just go to Settings > Background Updates > Update Interval and set it accordingly.

For Facebook also same settings can be done. You just need to go to settings from the main Facebook screen and there select Refresh interval from the menu. Set the time as per your requirement.

9. Disable GPS Location Features

As we all know, the apps which sync constantly suck battery a lot. GPS is one of those apps which top the list. When it is used for navigation battery of Samsung Galaxy S dies very fast. There are many applications which use GPS. To prevent such situation of drained battery due to GPS, change the GPS to use wireless networks and uncheck the option “Use GPS satellites”. This setting makes GPS a little less accurate which may become a problem but it helps in saving battery.

10. Use Task Manager

Using a task manager is one of the wisest options. You can use Advanced Task Cleaner or any other similar app to kill applications which are not required. Also you can monitor which application is launching itself repeatedly and hence you can setup an auto kill list for such applications. The function becomes more helpful when you configure advanced task manager to show CPU usage by every single app.

11. Disable/Remove Unused Apps

If an application can be disabled from being used in background, then it is fine otherwise you should remove it. Apps which drain battery most and hardly used must be removed. This can be done from Android battery panel or task manager. Just go to Settings > Applications > Manage Application and then click uninstall button to remove that specific app.

12. Disable Unused Screen Widgets

Some widgets also pull a lot of data from the web. Pulling of data every time even when it is not required hamper the performance of battery. That’s why such widgets which are hardly needed must be removed.

13. Power Saving Mode

Power Saving mode comes by default in Samsung Galaxy S phone. When activated, it automatically starts saving battery by functioning in proper way. To activate the power saving mode you must go to Applications > Settings > Sound and Display and then select “Power Saving Mode”. Once activated it will analyze the images and adjust LCD brightness to save battery.

14. Disable Live Wallpapers

Samsung Galaxy S was launched with beautiful live wallpaper. Live wallpaper looks really good but consumes battery also. So get rid of live wallpapers. It will surely help you in saving a small extra battery.

15. Use JuiceDefender

If all of the above options are looking like a big task then you can simply use JuiceDefender. JuiceDefender is a multipurpose application and the best in its class. It helps in saving battery of Android phones. In one of our earlier post we mentioned all its utility and how JuiceDefender helps in increasing battery life of Android devices.