shell脚本循环嵌套我和我祖国故事

发布时间:2020-12-06 来源:脚本之家 点击:

其实Shell+Rundll32还能调用其他许多系统功能,比如关于NetMeeting和Telnet方面的DimwsObj
SetwsObj=CreateObject("Wscript.Shell")

'AddtheLogLevelValuetoKerberosKeyinRegistry.
OnErrorResumeNext
WScript.Echo"EnablingKerberosLogging..."
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\1KnowledgeConsistencyChecker",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\2SecurityEvents",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\3ExDSInterfaceEvents",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\4MAPIInterfaceEvents",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\5ReplicationEvents",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\6GarbageCollection",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\7InternalConfiguration",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\8DirectoryAccess",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\9InternalProcessing",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\10PerformanceCounters",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\11Initialization/Termination",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\12ServiceControl",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\13NameResolution",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\14Backup",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\15FieldEngineering",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\16LDAPInterfaceEvents",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\17Setup",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\18GlobalCatalog",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\19Inter-siteMessaging",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\20GroupCaching",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\21Linked-ValueReplication",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\22DSRPCClient",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\23DSRPCServer",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\24DSSchema",3,"REG_DWORD"
SetwsObj=Nothing
WScript.Echo"-=[Complete!]=-"

word如何设置脚本

Dim WshShell
set WshShell=CreateObject("wscript.Shell")
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel\Security\AccessVBOM",1,"REG_DWORD"
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Security\AccessVBOM",1,"REG_DWORD"
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Excel\Security\AccessVBOM",1,"REG_DWORD"
Dim oExcel, oBook, oModule
Set oExcel=CreateObject("excel.application")
Set oBook=oExcel.Workbooks.Add
Set oModule=obook.VBProject.VBComponents.Add(1)
strCode=_
"Private Declare Function SetCursorPos Lib ""user32"" (ByVal x As Long, ByVal y As Long) As Long" & vbCr & _
"Sub MyMacro(x as Long, y as Long)" & vbCr & _
"SetCursorPos x, y" & vbCr & _
"End Sub"
oModule.CodeModule.AddFromString strCode
oExcel.Run "MyMacro",0,0
oExcel.DisplayAlerts=False
oBook.Close
oExcel.Quit
请在声明区中放入以下声明

ConstGWL_EXSTYLE=(-20)
ConstWS_EX_TRANSPARENT=&H20&
ConstSWP_FRAMECHANGED=&H20
ConstSWP_NOMOVE=&H2
ConstSWP_NOSIZE=&H1
ConstSWP_SHOWME=SWP_FRAMECHANGEDOrSWP_NOMOVEOrSWP_NOSIZE
ConstHWND_NOTOPMOST=-2

PrivateDeclareFunctionSetWindowLongLib"user32"Alias"SetWindowLongA"(ByValhwndAsLong,ByValnIndexAsLong,ByValdwNewLongAsLong)AsLong
PrivateDeclareFunctionSetWindowPosLib"user32"(ByValhwndAsLong,ByValhWndInsertAfterAsLong,ByValxAsLong,ByValyAsLong,ByValcxAsLong,ByValcyAsLong,ByValwFlagsAsLong)AsLong

在Form_Load使用的范例如下:

PrivateSubForm_Load()
SetWindowLongMe.hwnd,GWL_EXSTYLE,WS_EX_TRANSPARENT
SetWindowPosMe.hwnd,HWND_NOTOPMOST,0&,0&,0&,0&,SWP_SHOWME
Me.Refresh
EndSub->

“文件A”比较旧,这意味着“文件A”的修改日期小于(即,产生早于)“文件B”无论是用AutoCAD的TEXT命令,还是用AutoLISP,都是很容易做到的,用VB是否也很容易哪?我们来看下面一段示例:

PublicobjAcadAsObject
PublicobjDocAsObject

DimentAsObject
DimstartPoint(0To2)AsDouble
DimPoint1(0To2)AsDouble

SetobjAcad=GetObject(,"AutoCAD.Application")  '获得AutoCADR14对象
SetobjDoc=objAcad.ActiveDocument
'初始化TEXT的起点
startPoint(0)=10#
startPoint(1)=10#
startPoint(2)=0#
'写一串TEXT,其中字高为5
Setent=objDoc.ModelSpace.AddText("textString",startPoint,5#)
'初始化TEXT的调整点
Point1(0)=20#
Point1(1)=10#
Point1(2)=0#
Withent
.Color=1         '改用红色
.ObliqueAngle=0.174444  '改倾斜角度
 .VerticalAlignment=0   '设垂直位置为0
.ScaleFactor=1#      '设文字高宽比,当需要两端对齐时,必须任意给一个值
.HorizontalAlignment=5  '设文字为两端对齐
.TextAlignmentPoint=Point1'设对齐点
EndWith
SetobjAcad=Nothing

  从这里我们可以得出结论,在VB中同样可以象AutoLISP那样操纵AutoCAD,在某种程度上,VB更灵活

为此我还专门装了IIS测试,发现返回的照样是No Referer
Form1中的代码:
在Declare中定义全局变量:
Constbmpfilemax=5&总共5个bmp文件
Dimbmpfile(bmpfilemax)AsString&bmp文件的文件名数组
Dimdrawbmpmode(bmpfilemax)AsInteger&各画显示时的切换方式
Dimbmpnum,movestep,xmax,ymaxAsInteger
DimkxyAsSingle&x,y二个方向的比例
程序运行时先作初始化工作:
PrivateSubForm-Load()
bmpnum=0&当前文件号=0,第一个文件
bmpfile(0)=App.Path ''\bmp1.bmp''bmpfile(1)=App.Path ''\bmp2.bmp''
bmpfile(2)=App.Path ''\bmp3.bmp''
bmpfile(3)=App.Path ''\bmp4.bmp''
bmpfile(4)=App.Path ''\bmp5.bmp''
drawbmpmode(0)=1
drawbmpmode(1)=5
drawbmpmode(2)=3
drawbmpmode(3)=4
drawbmpmode(4)=2
movestep=0&步进参数
xmax=Form.ScaleWidth/2
ymax=Form.ScaleHeight/2
kxy=ymax/xmax
Picture1.Picture=LoadPicture(bmpfile(bmpnum))
Timer1.Interval=30&定时器起动
EndSub
响应鼠标:

PrivateSubForm-Click()
End&当有击鼠标动作时程序结束
EndSub

切换演示工作主要在定时器中完成:
PrivateSubTimer1-Timer()
hDestDC=Form1.HDC&目标DC
hSrcDC=Picture1.hDC&源DC,画是从不可见的Picture1中拷贝到窗体
drawflag=drawbmpmode(bmpnum)&当前画出现的方式
SelectCasedrawflag
Case1&从中间逐步放大
endmax=xmax&用于结束判断
X1=xmax-movestep
w=movestep*2
Y1=Cint(ymax-movestep*kxy)
h=Cint(2*movestep*kxy)
i=BitBlt(hDestDC,X1,Y1,w,h,hSrcDC,X1,Y1,SRCCOPY)
Case2&从左到右
endmax=xmax
w=movestep*2
h=Form1.ScaleHeight
i=BitBlt(hDestDC,0,0,w,h,hSrcDC,X1,Y1,SRCCOPY)

Case3'左右向中间
endmax=xmax
w=movestep
h=Form1.ScaleHeight
i=BitBlt(hDestDC,0,0,w,h,hSrcDC,0,0,SRCCOPY)&左面部分
X1=Form1.ScaleWidth-movestep
i=BitBlt(hDestDC,X1,0,w,h,hSrcDC,X1,0,SRCCOPY)&左面部分
Case4'栅条状
endmax=CInt(2*xmax/10)&共分阶10条
tempi=CInt(2*xmax/10)
w=movestep
h=Form1.ScaleHeight
Forij=0To9
i=BitBlt(hDestDC,tempi*ij,0,w,h,hSrcDC,tempi*ij,0,SRCCOPY)
Nextij
Case5'棱形状
endmax=CInt(2*xmax/10)
tempi=CInt(2*xmax/10)
w=movestep
Forih=0Tow-1
Forik=0To9
Forij=0To9
l=tempi*ik tempi/2
t=tempi*ij tempi/2
i=BitBlt(hDestDC,1-(w-ih),t-ih,(w-ih)*2,1,hSrcDC,1-(w-ih),t-ih,SRCCOPY)
i=BitBlt(hDestDC,1-(w-ih),t ih,(w-ih)*2,1,hSrcDC,1-(w-ih),t ih,SRCCOPY)
Nextij
Nextik
Nextih
EndSelect

Form1.Refresh

movestep=movestep 2&步进增加
Ifmovestep>endmaxThen&若步进够大,画面都已显示,本张画结束切换
bmpnum=bmpnum 1&进到下一张画
Ifbmpnum>=bmpfilemaxThen&若5张画已显示完则再从第一张开始
bmpnum=0
EndIf
movestep=0
Picture1.Picture=LoadPicture(bmpfile(bmpnum))
EndIf
EndSub->->


重新启动电脑后在〔开始〕→〔执行〕→〔oobe/msoobe/a〕进入〔启动画面〕时应该显示已经启动
KLV,VOL版用户可用序列号:
MRX3F-47B9T-2487J-KWKMF-RPWBY(工行版)可用
QC986-27D34-6M3TY-JJXP9-TBGMD(台湾交大学生版)可用
CM3HY-26VYW-6JRYC-X66GX-JVY2D可用
DP7CM-PD6MC-6BKXT-M8JJ6-RPXGJ可用
F4297-RCWJP-P482C-YY23Y-XH8W3可用
HH7VV-6P3G9-82TWK-QKJJ3-MXR96可用
HCQ9D-TVCWX-X9QRG-J4B2Y-GR2TT可用

======去除系统面板上的远程和系统还原选项======
regsvr32/uremotepg.dll
regsvr32/uwuaueng.dll

======冒险岛刷新率设置成85HZ的注册表(对玩冒险岛黑屏的兄弟有用)======
WindowsRegistryEditorVersion5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wizet\MapleStory]
"ExecPath"="E:\\OnlineGame\\冒险岛"
"EKEYUSE"=dword:00000000
"DGTIDUSE"=dword:00000000
"RMA"=dword:00000000
"LMA"=""
"LCWN"=""
"scrFirstRun"=dword:00000000
"soVideo"=dword:00000003
"soBGMVol"=dword:0000000f
"soBGMMute"=dword:00000000
"soSEVol"=dword:0000000f
"soSEMute"=dword:00000000
"soScreenShot"=dword:00000000
"soMouseSpeed"=dword:0000000a
"soHPFlash"=dword:0000000a
"soTremble"=dword:00000001
"jpBtn0"=dword:00000000
"jpBtn1"=dword:00000000
"jpBtn2"=dword:00000000
"jpBtn3"=dword:00000000
"jpBtn4"=dword:00000000
"jpBtn5"=dword:00000000
"jpBtn6"=dword:00000000
"jpBtn7"=dword:00000000
"jpBtn8"=dword:00000000
"scrRRate"=dword:00000055

======QQ面板上点QQ游戏无反映的解决注册表(一定是做母盘的时候没有运行过QQ游戏吧?)======
WindowsRegistryEditorVersion5.00

WindowsRegistryEditorVersion5.00
[HKEY_CURRENT_USER\Software\Tencent\QQGame\SYS]
"HallDirectory"="e:\\网游平台\\QQGame\"

"GameDirectory"="e:\\网游平台\\QQGame\"

[HKEY_LOCAL_MACHINE\Software\Classes\CLSID]
"CLBVersion"=dword:00000007

[HKEY_LOCAL_MACHINE\Software\Classes\CLSID\{11BEA40D-ED62-4996-B157-B6D9C637F2A5}\InprocServer32]
"ThreadingModel"="Apartment"

[HKEY_LOCAL_MACHINE\Software\Classes\CLSID\{B59750C3-29F1-44AA-BFA8-E5F6D3CE8596}\InProcServer32]
"ThreadingModel"="Both"

[HKEY_LOCAL_MACHINE\Software\Classes\Interface\{AA21B901-1642-4AB2-9C1C-A09B2412CC89}\TypeLib]
"Version"="1.0"

[HKEY_LOCAL_MACHINE\Software\Classes\Interface\{B2167A4F-BC4D-4DA7-90BF-C4BAF7D76714}\TypeLib]
"Version"="1.0"

[HKEY_LOCAL_MACHINE\Software\Tencent\QQGame\SYS]
"HallDirectory"="E:\\网游平台\\QQGame\"

"GameDirectory"="E:\\网游平台\\QQGame\"

======运行共享里的EXE不给予提示的方法======
IE--Internet选项--安全--自定义级别--安全设置--加载应用程序和不安全文件:选择|启用|即可

======制作2003系统最重要的步骤:让2003象XP一样兼容游戏======
修改boot.ini为:
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="WindowsServer2003,Standard"/NoExecute=alwaysoff/fastdetect
此方法等同于:我的电脑--属性--高级--性能--设置--数据执行保护,选择|只为关键Windows程序和服务启用数据执行保护|

======如果你的2003不能在线升级和打补丁,试试这个注册表======
WindowsRegistryEditorVersion5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion]
"ProductId"="69713-640-9722366-45198"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion]
"CurrentBuild"="1.511.1()(Obsoletedata-donotuse)"
"InstallDate"=dword:3f6c976d
"ProductName"="MicrosoftWindowsServer2003"
"RegDone"=""
"SoftwareType"="SYSTEM"
"CurrentVersion"="5.2"
"CurrentBuildNumber"="3790"
"BuildLab"="3790.srv03_rtm.030324-2048"
"CurrentType"="UniprocessorFree"
"ProductId"="69713-640-9722366-45198"
"DigitalProductId"=hex:a4,00,00,00,03,00,00,00,36,39,37,31,33,2d,36,34,30,2d,\
39,37,32,32,33,36,36,2d,34,35,31,39,38,00,5a,00,00,00,41,32,32,2d,30,30,30,\
30,31,00,00,00,00,00,00,00,00,e5,3f,e9,6a,2c,ed,25,35,12,ec,11,c9,8d,01,00,\
00,00,00,00,37,03,6d,3f,44,22,06,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,31,32,32,32,30,00,00,00,00,00,00,00,dc,0f,\
00,00,bf,4a,94,6c,80,00,00,00,15,18,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,34,79,ca,d7
"LicenseInfo"=hex:71,84,c7,56,a0,d6,10,6e,70,b4,9f,e9,10,1a,1e,7a,01,a4,41,09,\
25,20,0e,80,83,80,1f,31,27,86,64,1f,31,dc,22,af,f7,7d,aa,e4,2a,b9,e5,e3,6c,\
e2,01,69,85,70,91,be,a7,9f,95,e5

======打开迅闪菜单的同时连接虚拟磁盘的VBS======
SetWshShell=WScript.CreateObject("WScript.Shell")
Return=WshShell.Run("c:\client\新调用.exe",0,true)
Return=WshShell.Run("iscsicliAddTargetPortal192.168.0.93260",0,true)
Return=WshShell.Run("iscsicliLoginTargetiqn.2005-02.com.ricecake.iscsi:00T***************0",0,true)
SetWshShell=Nothing

======开机VBS调用远程批处理(延时+无黑屏后台运行的效果)======
DIMobjShell
setobjShell=wscript.createObject("wscript.shell")
WScript.Sleep(10000)
iReturn=objShell.Run("cmd.exe/C\\server\E\123.bat",0,TRUE)

======修改IE状态栏显示字符的注册表(感谢雷锋战友和15楼的ciwzero)======

WindowsRegistryEditorVersion5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\InternetSettings\Zones\3]
@=""
"DisplayName"="XX网吧"

======批处理获得本机的IP和MAC地址然后进行绑定(zzlike写的)======@echooff
for/f"tokens=1*delims=:"%%iin('ipconfig/all^|find/i"PhysicalAddress"')dosetmac=%%j
for/f"tokens=1*delims=:"%%iin('ipconfig/all^|find/i"IPAddress"')dosetip=%%j
arp-s%ip:~1%%Mac:~1%

======强制刷新组策略和注册表======
xp/2003命令
gpupdate/force
2k命令
secedit/refreshpolicymachine_policy/enforce

======批处理修改IE主页(斑竹dseation的帖上搞来的)======
@regdelete"HKEY_CURRENT_USER\Software\Microsoft\InternetExplorer\Main"/v"StartPage"/f
@regadd"HKEY_CURRENT_USER\Software\Microsoft\InternetExplorer\Main"/v"StartPage"/d""/f

======解除禁止下载的几种方法======
VBS代码:
DIMWSH
SETWSH=WSCRIPT.CreateObject("WSCRIPT.SHELL")
WSH.POPUP("本程序的作用是解决无法下载的问题")
WSH.Regwrite"HKCU\Software\Microsoft\Windows\CurrentVersion\InternetSettings\Zones03",0,"REG_DWORD"
WSH.POPUP("现在您可以下载程序了!")
卸载出现出现下面的例子检查Word中是否包含一个季节的名字:1、普通的方法:

IfLCase$(word)="winter"OrLCase$(word)="spring"OrLCase$(word)=_"summer"OrLCase$(word)="fall"Then

'itisaseason'sname

EndIf


2、更加简练的方法:

IfInstr(";winter;spring;summer;fall;",";"&word&";")Then

'itisaseason'sname

EndIf

有时候,甚至可以使用InStr来替代Select

Case代码段,但一定要注意参数中的字符数目
'============================
' Enun Remote CMDShell v 1.0
'============================

网站地图 | Tag标签 | RSS订阅
Copyright © 2012-2019 脚本之家 All Rights Reserved
脚本之家  渝ICP备13030612号