-
Top Posts
- WCF username authorization
- Where should I distinct and sort data result from NHibernate?
- Moving WCF Service to IIS
- Eager Fetch or Fetch Join?
- Create your own Parts to merge Stored Procedure into Fluent NHibernate mappings
- Datetime compare problem when using Stored Procedure in NHibernate
- Should always ignoreArgument when AssertWasCalled
- Install Dreamweaver CS3 conficts with old version flash player
- LinQ to SQL takes dynamic cretira
- Fluent NHibernate
Category Cloud
Tags
ActiveRecord Authorization cruisecontrol cvs Databinding DetailsView dreamweaver eventhandler exception Firefox fluent NHibernate gdata Generic ListView log mocha MVC MVVM NCover NHibernate NUnit OrcaScript Paging pattern python Repository Rhino RhinoMocks RollBack Security stored procedure StructureMap svn SySam test TFS UI Validation version WinForms
Category Archives: Windows
Problem: chm file can be opened locally but not from network drive. Might be an IE7 or windows security patch problem?
Solution:
Change registry:
REGEDIT4 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp] [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\ItssRestrictions] "MaxAllowedZone"=dword:00000003
I used to have a “MaxAllowdZone = 2″, which means opening chm file from internet is not allowed. After changing it to 3, problem went away.
For some reason, this value comes back to default value 2 everyday on my workstation. Might because our company’s policy, so I created a batch file to re-set it on my startup.
reg add HKLM\SOFTWARE\Microsoft\HTMLHelp\1.x\ItssRestrictions /v MaxAllowedZone /t REG_DWORD /d 3 /f
I wish this image converter tool can support command-line mode, so I could make my little tiny wallpaper changer bat file more powerful.
::== randomSetWallpaper.bat
@echo off
setLocal EnableDelayedExpansion
set ImageDir=”I:\My Documents\My Pictures\wallpaper\”
set ImageList=!ImageDir!”*.bmp”
:: This might be different on each machine.
set ImageOfToday=”C:\Documents and Settings\TEMP\Local Settings\Application Data\Microsoft\Wallpaper1.bmp”
for /f %%A in (‘dir /b !ImageList!^|find /v /c “\”‘) do set C=%%A
:loop
::set R=!random:~-3!
:: %RANDOM% – expands to a random decimal number between 0 and 32767.
:: Here we only need 3 digitals, the tolal number of files won’t be greater than 999.
set R=!random:~-100!
if !R! gtr !C! goto :loop
if !R! equ 0 goto :loop
for /f “tokens=*” %%A in (‘dir /b !ImageList!’) do (
set /a N+=1
rem Step by step to find the marked point. !R! ( !N! is adcting as an indicator.)
rem The /A switch specifies that the string to the right of the equal sign is a numerical expression that is evaluated.
if !N! equ !R! copy !ImageDir!%%A !ImageOfToday! && goto :eof
rem an extra doulbe quote seems OK here.
)
goto :eof
:: DONE
It works, but, what a pity I had to convert all the images to bmp format in advance!
Another drawback is, this NEW wallpaper won’t be in effect until next time login, because I don’t know how to refresh the desktop settings.
The purpose of ‘setLocal EnableDelayedExpansion‘:
if you want the variable to be expanded at execution time rather than at parse time? For that, you use “delayed expansion”, which is enabled by the
/Vcommand line option or by using theSETLOCAL ENABLEDELAYEDEXPANSIONcommand in a batch file.-from The old new thing.
If XP is in workgroup mode, all remote login will be treat as guest account. to disable it, you must set the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\forceguest to 0. (The default is 1.)
