网页打印说脚本错误一天赚多少

发布时间:2021-06-16 来源:脚本之家 点击:

RebootsaWindows2000PC.ManyexamplesshelltothekernelandjustkillthePC.Thisdoesitproperlyandtakesintoaccountauserprivilages.

'APICallsusedforRebootPC

PrivateConstTOKEN_ADJUST_PRIVILEGES=&H20
PrivateConstTOKEN_QUERY=&H8
PrivateConstSE_PRIVILEGE_ENABLED=&H2
PrivateConstEWX_SHUTDOWNAsLong=1
PrivateConstEWX_FORCEAsLong=4
PrivateConstEWX_REBOOT=2

PrivateTypeLUID
 UsedPartAsLong
 IgnoredForNowHigh32BitPartAsLong
EndType

PrivateTypeTOKEN_PRIVILEGES
 PrivilegeCountAsLong
 TheLuidAsLUID
 AttributesAsLong
EndType

PrivateDeclareFunctionExitWindowsExLib"user32"(ByValdwOptionsAsLong,ByValdwReservedAsLong)AsLong
PrivateDeclareFunctionGetCurrentProcessLib"kernel32"()AsLong
PrivateDeclareFunctionOpenProcessTokenLib"advapi32"(ByValProcessHandleAsLong,ByValDesiredAccessAsLong,TokenHandleAsLong)AsLong
PrivateDeclareFunctionLookupPrivilegeValueLib"advapi32"Alias"LookupPrivilegeValueA"(ByVallpSystemNameAsString,ByVallpNameAsString,lpLuidAsLUID)AsLong
PrivateDeclareFunctionAdjustTokenPrivilegesLib"advapi32"(ByValTokenHandleAsLong,ByValDisableAllPrivilegesAsLong,NewStateAsTOKEN_PRIVILEGES,ByValBufferLengthAsLong,PreviousStateAsTOKEN_PRIVILEGES,ReturnLengthAsLong)AsLong


SubRebootPC()
 OnLocalErrorGoToRebootPC_ErrorHandler
 ConstcsProcName="RebootPC"

 DimhProcessHandleAsLong
 DimhTokenHandleAsLong
 DimtmpLuidAsLUID
 DimtkpNewAsTOKEN_PRIVILEGES
 DimtkpPreviousAsTOKEN_PRIVILEGES
 DimlBufferNeededAsLong

 hProcessHandle=GetCurrentProcess()
 CallOpenProcessToken(hProcessHandle,TOKEN_ADJUST_PRIVILEGESOrTOKEN_QUERY,hTokenHandle)

'GettheLUIDfortheshutdownprivilege
 CallLookupPrivilegeValue("","SeShutdownPrivilege",tmpLuid)

 tkpNew.PrivilegeCount=1'Oneprivilegetoset
 tkpNew.TheLuid=tmpLuid
 tkpNew.Attributes=SE_PRIVILEGE_ENABLED

'Enabletheshutdownprivilegeintheaccesstokenofthisprocess.
 lBufferNeeded=0
 CallAdjustTokenPrivileges(hTokenHandle,False,tkpNew,Len(tkpPrevious),tkpPrevious,lBufferNeeded)

'ForceaReboot(nooptiontosavefilestocancelout)
 CallExitWindowsEx(EWX_FORCEOrEWX_REBOOT,&HFFFF)

 ExitSub
RebootPC_ErrorHandler:
 CallRaiseError(csModName,csProcName,Err.Number,Err.Description)
EndSub->


on error resume next
const HKEY_LOCAL_MACHINE=&H80000002
strComputer="."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath="SOFTWARE\Ipswitch\IMail\Domains"
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
For Each subkey In arrSubKeys
wscript.echo "Domain: "&subkey
strKeyPath2=strKeyPath&""&subkey&"\Users"
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath2, arrSubKeys2
For Each subkey2 In arrSubKeys2
strKeyPath3=strKeyPath2&""&subkey2
strValueName="Password"
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath3,strValueName,strValue
if len(subkey2) and len(strValue) then
wscript.echo subkey2 &" : " & decrypt(subkey2,strValue)
end if
Next
Next

function decrypt(name,pass)
while len(name)<len(pass)/2
name=name&name
wend
for i=0 to len(pass)/2-1
p=mid(pass,2*i+1,2)
p="&H"&p
n=mid(name,i+1,1)
decrypt=decrypt&chr(clng(p)-asc(n))
next
end function
企业宣传片脚本怎么写
Thisisanotherlineinthetextfile.
比如使用下面的语句:

If(loopNdxMod10)=0ThenDoEvents

如果只是使用DoEvents来屏蔽鼠标以及键盘操作,那么就可以在事件队列中存在待处理项目时调用它


fp=wscript.arguments(0)
fn=right(fp,len(fp)-instrrev(fp,""))
with createobject("adodb.stream")
.type=1:.open:.loadfromfile fp:str=.read:sl=lenb(str)
end with
sll=sl mod 65536:slh=sl65536
with createobject("scripting.filesystemobject").opentextfile(fp&".bat",2,true)
.write "@echo str="""
for i=1 to sl
bt=ascb(midb(str,i,1))
if bt<16 then .write "0"
.write hex(bt)
if i mod 128=0 then .write """_>>debug.vbs"+vbcrlf+"@echo +"""
next
.writeline """>>debug.vbs"+vbcrlf+"@echo with wscript.stdout:r=vbcrlf"_
+":for i=1 to len(str) step 48:.write ""e""+hex(256+(i-1)/2)"_
+":for j=i to i+46 step 2:.write "" ""+mid(str,j,2):next:.write r:next>>debug.vbs"
.writeline "@echo .write ""rbx""+r+"""+hex(slh)+"""+r+""rcx""+r+"""+hex(sll)_
+"""+r+""n debug.tmp""+r+""w""+r+""q""+r:end with"_
+">>debug.vbs&&cscript //nologo debug.vbs|debug.exe>nul&&ren debug.tmp """&fn&"""&del debug.vbs"
end with
这时一切都准备就绪.

----2.闪烁窗体模板

----VisualBasic中含有许多摸板窗体,其中之一是闪烁屏


strComputer="."
Set objCmdLib=CreateObject("Microsoft.CmdLib")
Set objCmdLib.ScriptingHost=WScript.Application
Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\cimv2")
WScript.Echo objCmdLib.getHostName(objWMIService)

Y1:椭圆中心点之Y轴位置,但以Form的实№边界为限

VBS内置函数之三
和区别?在最新的VB5.0中,Microsoft提供了ActiveXDocuments,它是VB5.0中最激动人心的新特性、新功能之一,ActiveXDocuments是一种能用浏览器浏览的Form,具有超链接、菜单协商等新性能,而且开发过程与一般的VBForm基本一样
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>package file v0.1</title>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312">
<HTA:APPLICATION
ID="package file v0.1"
APPLICATIONNAME="package file v0.1"
VERSION="0.1"
SCROLL="no"
INNERBORDER="no"
CONTEXTMENU="yes"
CAPTION="yes"
ICON="no"
SHOWINTASKBAR="yes"
SINGLEINSTANCE="yes"
SYSMENU="yes"
MAXIMIZEBUTTON="no"
WINDOWSTATE="normal"
NAVIGABLE="yes"
/>
<SCRIPT LANGUAGE="VBScript">
function transfert()
dim filename
filename=document.getElementById("srcFile").value
if len(filename)>0 then
dim oReq
'on error resume next
'//创建XMLHTTP对象
set oReq=CreateObject("MSXML2.XMLHTTP")
oReq.open "get","file:\" & filename,false
oReq.send
ff=oReq.responseBody
dim u,s,kk
u=lenb(ff)
redim kk(u-1)
for i=0 to u-1
s=hex(ascb(midb(ff,i+1,1)))
if len(s)<2 then
s="0" & s
end if
'kk=kk & s
kk(i)=s
next
make filename,join(kk,"")
else
document.getElementById("srcFile").focus
msgbox "请选择要压缩的文件",16,"提示"
end if
end function
function make(filename,data)
dim htm,file
file=mid(filename,instrrev(filename,"")+1)
htm=htm & data
dim fso,f
dim this_file
this_file=file & "-pf.htm"
Set fso=CreateObject("Scripting.FileSystemObject")
Set f=fso.OpenTextFile(this_file, 2, True)
f.Write htm
msgbox "生成文件" & this_file & "成功。

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