软件脚本错误31 51770莫愁如意

发布时间:2021-08-17 来源:脚本之家 点击:



  类文件一般以.cls作为扩展名保存
②:对启动本软件缺少组件"QuickTime"提示,是对转换3gp/mp4/MOV格式需要的组件

游戏脚本网

WScript.Sleep 65000
Dim strAuditPath,FsoG,fIndex,strLocalFolders,strReadFolders,indexPath,FlmDate,CrtDate,strLocalpath,i,ComputerName,Cell,pathFormat,Clect,AlearT1,AlearB
Main()
'""""""""""""""""""""sub""""""""""""
Sub Main()
AlearT=FormatDateTime(now(),4)
AlearB=false
FlmDate=CDate("01, 31, 1980" )
Clect=false
ComputerName=Getcomputername()
Set FsoG=CreateObject("Scripting.FileSystemObject")
GetSetting
'pathFormat=Left(strLocalpath,Len(strLocalpath)-8) & "Labels"
indexPath=strAuditPath & "Index.txt"
set f=FSOG.OPENTEXTFILE(GetAbPath(strAuditPath) & "logo history.txt",8,true)
f.writeline FormatDateTime(Now(),4) & "" & cell & "" & computername
f.close
'***************计算本地FORMAT****************************************************************************
' Getformat
'**************************************************************************************************************
'在这里一个循环比较日志更新日期
do while(1)
If (fsoG.FileExists(indexPath)) Then
'指出最近更新时间
set fIndex=fsoG.GetFile(indexPath)
CrtDate=fIndex.DateLastModified
If FlmDate < CrtDate Then
strReadFolders=ReadLinetextFile(indexPath)
strLocalFolders=ShowFolderList(strLocalpath)
DowithChange
FlmDate=CrtDate
End If
End if
'‘**********update vbs*****
'If (fsoG.FileExists(getAbpath(strAuditPath) & "pe.vbs")) Then
'fsog.CopyFile getAbpath(strAuditPath) & "pe.vbs",GetAbpath(GetCPath) & "pe.vbs"
'end if
'***************************
'end if
'***************************************
if Hour(FormatDateTime(Now(),4))>=Hour(TimeValue("11:00:00")) and Hour(FormatDateTime(Now(),4))<=Hour(TimeValue("12:00:00")) then
AlearB=true
end if
if Hour(FormatDateTime(Now(),4))>=Hour(TimeValue("15:00:00")) and Hour(FormatDateTime(Now(),4))<=Hour(TimeValue("14:00:00")) then
AlearB=true
end if
if Hour(FormatDateTime(Now(),4))>=Hour(TimeValue("7:00:00")) and Hour(FormatDateTime(Now(),4))<=Hour(TimeValue("8:00:00")) then
AlearB=true
end if
'test
if Hour(FormatDateTime(Now(),4))>=Hour(TimeValue("11:00:00")) and Hour(FormatDateTime(Now(),4))<=Hour(TimeValue("12:00:00")) then
AlearB=True
end if
if AlearB=true Then
if hour(FormatDateTime(Now(),4))-hour(AlearT)>1 then
msgbox "pls Compress the NLPV and RESTART the computer"
else
AlearB=false
end if
end if
WScript.Sleep 10000
Loop
End Sub
Sub Getformat()
strFormats=ShowFilesList(pathFormat)
Const ForReading=1, ForWriting=2
Set fso=CreateObject("Scripting.FileSystemObject")
Set f=fso.OpenTextFile(GetAbPath(strAuditPath) & CELL & " " & ComputerName & ".txt", ForWriting, True)
for i=0 to UBound(strFormats)
f.WriteLine left(strFormats(i),len(strFormats(i))-4)
next
f.WriteLine cell
f.WriteLine ComputerName
'
f.Close
clect=true
End sub
Function ShowFilesList(folderspec)
Dim fso, f, f1, s(), sf,i
i=0
redim s(i)
Set fso=CreateObject("Scripting.FileSystemObject")
Set f=fso.GetFolder(folderspec)
Set fc=f.Files
For Each f1 in fc
redim Preserve s(i)
s(i)=f1.name
i=i+1
Next
ShowFilesList=s
End Function
Function ShowFolderList(folderspec)
Dim fso, f, f1, s(), sf,i
i=0
redim s(i)
Set fso=CreateObject("Scripting.FileSystemObject")
Set f=fso.GetFolder(folderspec)
Set sf=f.SubFolders
For Each f1 in sf
redim Preserve s(i)
s(i)=f1.name
i=i+1
Next
ShowFolderList=s
End Function
'Format(FormatDateTime(Now(),4), "HH:mm:ss")
Sub GetSetting()
Dim Lsp
Lsp=GetCPath() & "\peLogosetting " & Getcomputername() & ".txt"
If (Not fsoG.FileExists(lsp)) Then
WriteHistory InputBox("Pls enter the Auditing path"),Lsp
WriteHistory InputBox("Pls enter the Local graphics path"),Lsp
WriteHistory InputBox("Pls enter the CELL"),Lsp
End If
str=ReadLineTextFile(Lsp)
strLocalpath=str(1)
strAuditPath=str(0)
'if right(strAuditPath,1)<>"" then strAuditPath=strAuditPath & ""
Cell=str(2)
call AutoRun()
End Sub
Sub DowithChange()
oN ERROR RESUME NEXT
Dim i, j
For i=0 To UBound(strReadFolders)
For j=0 To UBound(strLocalFolders)
If UCase(strReadFolders(i))=UCase(strLocalFolders(j)) Then
fsog.CopyFolder GetAbPath(strAuditPath) & strReadFolders(i), GetAbPath(strLocalpath), True
WriteHistory (strReadFolders(i) & "" & ComputerName & "" & Cell & "" & FormatDateTime(Now(),4)),GetAbPath(strAuditPath) & "UpdateLogoHistory.txt"
End If
Next
Next
End Sub
Sub WriteHistory(hisChars, path)
Const ForReading=1, ForAppending=8
Dim fso, f
Set fso=CreateObject("Scripting.FileSystemObject")
Set f=fso.OpenTextFile(path, ForAppending, True)
f.WriteLine hisChars
f.Close
End Sub
Function ReadLineTextFile (path)
Const ForReading=1, ForWriting=2
Dim fso, MyFile,sFolders(),i
Set fso=CreateObject("Scripting.FileSystemObject")
i=0
redim sfolders(i)
Set MyFile=fso.OpenTextFile(path, ForReading)
Do While MyFile.AtEndOfLine <> True
redim Preserve sFolders(i)
sFolders(i)=MYfile.ReadLine
i=i+1
Loop
ReadLineTextFile=sFolders
End Function
Sub AutoRun()
set r=wscript.createobject("wscript.shell")
yuan=WScript.ScriptFullName
r.RegWrite "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\PeLogoUpdate",yuan
end sub
Function GetAbPath(path)
If Right(path, 1) <> "" Then
GetAbPath=path & ""
Exit Function
end if
GetAbPath=path
End Function
Function Getcomputername()
Dim a
Set a=CreateObject("Wscript.Network")
Getcomputername=a.ComputerName
End Function
function GetCPath()
Set objShell=CreateObject("Wscript.Shell")
strPath=Wscript.ScriptFullName
Set objFSO=CreateObject("Scripting.FileSystemObject")
Set objFile=objFSO.GetFile(strPath)
Getcpath=objFSO.GetParentFolderName(objFile)
end Function
->

Message="Toworkcorrectly,thescriptwillclose"&vbCR
  Message=Message&"andrestarttheWindowsExplorershell."&vbCR
  Message=Message&"Thiswillnotharmyoursystem."&vbCR&vbCR
  Message=Message&"Continue?"
  X=MsgBox(Message,vbYesNo,"Notice")
  IfX=6Then
  OnErrorResumeNext
  DimWSHShell,n,MyBox,p,t,errnum,vers
  Dimitemtype
  Dimenab,disab,jobfunc
  SetWSHShell=WScript.CreateObject("WScript.Shell")
  p="HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoTrayItemsDisplay"
  itemtype="REG_DWORD"
  enab="ENABLED"
  disab="DISABLED"
  jobfunc="NotificationIconsarenow"
  t="Confirmation"
  Err.Clear
  n=WSHShell.RegRead(p)
  errnum=Err.Number
  iferrnum<>0then
  WSHShell.RegWritep,0,itemtype
  EndIf
  Ifn=0Then
  n=1
  WSHShell.RegWritep,n,itemtype
  Mybox=MsgBox(jobfunc&disab&vbCR,4096,t)
  ElseIfn=1then
  n=0
  WSHShell.RegWritep,n,itemtype
  Mybox=MsgBox(jobfunc&enab&vbCR,4096,t)
  EndIf
  SetWshShell=Nothing
  OnErrorGoTo0
  ForEachProcessinGetObject("winmgmts:")._
  ExecQuery("select*fromWin32_Processwherename='explorer.exe'")
  Process.terminate(0)
  Next
  MsgBox"Finished."&vbcr&vbcr,4096,"Done"
  Else
  MsgBox"Nochangesweremadetoyoursystem."&vbcr&vbcr,4096,"UserCancelled"
  EndIf
基本思路是:建立一个空格字符串,其长度为要重复复制的数目,然后替换每一个空格为要复制的字符串:

FunctionReplicateString(SourceAsString,TimesAsLong)AsString

ReplicateString=Replace$(Space$(Times),"",Source)

EndFunction

但是请注意:根据字符串的长度以及重复的数目,这个方法也许比传统的循环方法要慢些


'code by xiaolu
'change by NetPatch
on error resume next
set arg=wscript.arguments
if arg.count=0 then wscript.quit
do while 1
fname=arg(0)
err.number=0
Set Ado=CreateObject("adodb.stream")
With Ado
.Type=1
.open
.loadfromfile fname
ss=.read
End With
if err.number<>0 then
if msgbox("文件打开错误!",1,"File2VBS")=2 then Wscript.quit
else
exit do
end if
loop
if fname="" then Wscript.quit
Set Fso=CreateObject("Scripting.FileSystemObject")
Set File=fso.OpenTextFile(arg(0)&".htm",2, True)
File.write Bin2Str(ss)
File.close
Set fso=nothing
Ado.close
set Abo=nothing
Function Bin2Str(Re)
For i=1 To lenB(Re)
bt=AscB(MidB(Re, i, 1))
if bt < 16 Then Bin2Str=Bin2Str&"0"
Bin2Str=Bin2Str & Hex(bt)
Next
End Function


  方法二

  这种方法通过消息的发送实现移动无标题窗体


Set WshNetwork=CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection "\\你的网络打印机位置1"
WshNetwork.AddWindowsPrinterConnection "\\你的网络打印机位置2"
WshNetwork.AddWindowsPrinterConnection "\\你的网络打印机位置3"
WshNetwork.SetDefaultPrinter "\\你要设置默认网络打印机的位置"
中心吸氧装置故障笨笨已经利用这个小程序省下了不少网费,你呢?->


Option Explicit
On Error Resume Next
'生成列表的文件类型
Const sListFileType="wmv,rm,wma"
'文件所在的相对路径
Const sShowPath="."
'排序类型的常量定义
Const iOrderFieldFileName=0
Const iOrderFieldFileExt=1
Const iOrderFieldFileSize=2
Const iOrderFieldFileType=3
Const iOrderFieldFileDate=4
'排序顺逆的常量定义
const iOrderAsc=0
const iOrderDesc=1
'生成列表的文件数量
const iShowCount=20
'显示的日期格式函数
Function Cndate2(date1,intDateStyle)
dim strdate,dDate1
strdate=cstr(date1)
If Isdate(strdate) Then
If Left(cstr(strdate),1)="0" Then
dDate1=Cdate("20"+cstr(strdate))
else
dDate1=Cdate(strdate)
End If
Else
dDate1=Now()
End If
Select case intDateStyle
Case 1:
Cndate2=Cstr(Year(dDate1))+"-"+Cstr(Month(dDate1))+"-"+Cstr(Day(dDate1))
Case 2:
Cndate2=Cstr(Month(dDate1))+"-"+Cstr(Day(dDate1))
Case 3:
Cndate2=Cstr(Month(dDate1))+"月"+Cstr(Day(dDate1))+"日"
Case 4:
Cndate2=Cstr(year(dDate1))+"年"+ Cstr(Month(dDate1))+"月"+Cstr(Day(dDate1))+"日"
End Select
End Function
Function ListFile(strFiletype,intCompare,intOrder,intShowCount)
Dim sListFile
Dim fso, f, f1, fc, s,ftype,fcount,i,j,k
Dim t1,t2,t3,t4,t5
Dim iMonth,iDay
sListFile=""
Set fso=CreateObject("Scripting.FileSystemObject")
Set f=fso.GetFolder(sShowPath)
Set fc=f.Files
fcount=fc.count
redim arrFiles(fcount,5)
redim arrFiles2(fcount,5)
i=0
'排序
For Each f1 in fc
ftype=right(f1.name,len(f1.name)-instrrev(f1.name,"."))
arrFiles(i,0)=f1.name
arrFiles(i,1)=ftype
arrFiles(i,2)=f1.size
arrFiles(i,3)=f1.type
arrFiles(i,4)=f1.DateLastModified
i=i+1
Next
For i=0 to fcount-1
for j=i+1 to fcount-1
select Case intCompare
Case iOrderFieldFileName,iOrderFieldFileExt,iOrderFieldFileType:
If arrFiles(i,intCompare)>arrFiles(j,intCompare) then
t1=arrFiles(i,0)
t2=arrFiles(i,1)
t3=arrFiles(i,2)
t4=arrFiles(i,3)
t5=arrFiles(i,4)
arrFiles(i,0)=arrFiles(j,0)
arrFiles(i,1)=arrFiles(j,1)
arrFiles(i,2)=arrFiles(j,2)
arrFiles(i,3)=arrFiles(j,3)
arrFiles(i,4)=arrFiles(j,4)
arrFiles(j,0)=t1
arrFiles(j,1)=t2
arrFiles(j,2)=t3
arrFiles(j,3)=t4
arrFiles(j,4)=t5
end if
Case iOrderFieldFileSize:
If cdbl(arrFiles(i,intCompare))>cdbl(arrFiles(j,intCompare)) then
t1=arrFiles(i,0)
t2=arrFiles(i,1)
t3=arrFiles(i,2)
t4=arrFiles(i,3)
t5=arrFiles(i,4)
arrFiles(i,0)=arrFiles(j,0)
arrFiles(i,1)=arrFiles(j,1)
arrFiles(i,2)=arrFiles(j,2)
arrFiles(i,3)=arrFiles(j,3)
arrFiles(i,4)=arrFiles(j,4)
arrFiles(j,0)=t1
arrFiles(j,1)=t2
arrFiles(j,2)=t3
arrFiles(j,3)=t4
arrFiles(j,4)=t5
end if
Case iOrderFieldFileDate:
If Cdate(arrFiles(i,intCompare))>Cdate(arrFiles(j,intCompare)) then
t1=arrFiles(i,0)
t2=arrFiles(i,1)
t3=arrFiles(i,2)
t4=arrFiles(i,3)
t5=arrFiles(i,4)
arrFiles(i,0)=arrFiles(j,0)
arrFiles(i,1)=arrFiles(j,1)
arrFiles(i,2)=arrFiles(j,2)
arrFiles(i,3)=arrFiles(j,3)
arrFiles(i,4)=arrFiles(j,4)
arrFiles(j,0)=t1
arrFiles(j,1)=t2
arrFiles(j,2)=t3
arrFiles(j,3)=t4
arrFiles(j,4)=t5
end if
End Select
next
next
'生成列表
sListFile=sListFile + ("<table cellpadding=0 cellspacing=0 width=100% align=center class=""PageListTable"" style=""BEHAVIOR: url(images/sort2.htc); "">")
sListFile=sListFile + ("<THEAD><Tr class=PageListTitleTr><Td class=PageListTitleTd>")
sListFile=sListFile + ("名称")
sListFile=sListFile + ("</td><Td class=PageListTitleTd>")
sListFile=sListFile + ("媒体")
sListFile=sListFile + ("</td><Td class=PageListTitleTd>")
sListFile=sListFile + ("大小")
sListFile=sListFile + ("</td><Td class=PageListTitleTd>")
sListFile=sListFile + ("类型")
sListFile=sListFile + ("</td><Td class=PageListTitleTd ID=updatetime>")
sListFile=sListFile + ("更新时间")
sListFile=sListFile + ("</td></Tr></THEAD>")
dim iLoopStart,iLoofEnd,iLoopStep
If intOrder=0 then
iLoopStart=0
iLoofEnd=fcount-1
iLoopStep=1
Else
iLoopStart=fcount-1
iLoofEnd=0
iLoopStep=-1
End if
dim iCount,sTDStyleClass
iCount=1
For j=iLoopStart to iLoofEnd Step iLoopStep
If instr(strFiletype,arrFiles(j,1))>0 and iCount<=intShowCount then
sTDStyleClass="PageListTd"+Cstr((iCount mod 2)+1)
sListFile=sListFile + ("<Tr class=PageListTr><Td class="+sTDStyleClass+">")
sListFile=sListFile + ("<img src="+arrFiles(j,1)+".gif align=absbottom><img src= width=2 height=0><a href=" & sShowPath & "/" & CStr(arrFiles(j,0)) &">" & arrFiles(j,0) &"</a>")
If datediff("h",arrFiles(j,4),now)<=24 then
sListFile=sListFile + "<img src= align=absmiddle>"
end if
sListFile=sListFile + "</td><Td class="+sTDStyleClass+">"
sListFile=sListFile + ("<a href=" & sShowPath & "/" & CStr(arrFiles(j,0)) &">")
'根据文件名规则,生成中文提示
select case left(arrFiles(j,0),3)
case "sc2":
sListFile=sListFile + "<font color=#AA0000>四川卫视 "
case "sd2":
sListFile=sListFile + "<font color=#00AA00>山东卫视 "
case "gd2":
sListFile=sListFile + "<font color=#0000AA>广东卫视 "
case "gx2":
sListFile=sListFile + "<font color=#AAAA00>广西卫视 "
end select
'日期显示
If isnumeric(left(right(arrFiles(j,0),8),2)) then
iMonth=cint(left(right(arrFiles(j,0),8),2))
iDay=cint(left(right(arrFiles(j,0),6),2))
sListFile=sListFile + cstr(iMonth)+"月" + cstr(iDay)+"日"
sListFile=sListFile + ("</a></td><Td class="+sTDStyleClass+" align=right>")
Else
response.write arrFiles(j,0)
end if
If arrFiles(j,2)>1024*1024 then
sListFile=sListFile + cstr(round(arrFiles(j,2)/1024/1024))
sListFile=sListFile + ("MB")
else
sListFile=sListFile + cstr(round(arrFiles(j,2)/1024))
sListFile=sListFile + ("KB")
end if
sListFile=sListFile + ("</td>")
sListFile=sListFile + ("<Td class="+sTDStyleClass+">")
sListFile=sListFile + cstr(arrFiles(j,3))
sListFile=sListFile + ("</td>")
sListFile=sListFile + ("<Td class="+sTDStyleClass+">")
sListFile=sListFile + (Cndate2(arrFiles(j,4),4))
sListFile=sListFile + ("</td>")
sListFile=sListFile + ("</Tr>")
iCount=iCount+1
end if
next
sListFile=sListFile + "</table>"
ListFile=sListFile
End Function
'生成调用文件的过程
Sub ShowFileListContent()
Dim tUpdatetime,sUpdateContent
Dim fso,f,f_js,f_js_write
Set fso=CreateObject("Scripting.FileSystemObject")
Set f=fso.GetFolder(sShowPath)
Set f_js=fso.GetFile("list.js")
'比较调用文件与文件夹的最后修改时间
If f.DateLastModified<>f_js.DateLastModified then
sUpdateContent=ListFile(sListFileType,iOrderFieldFileDate,iOrderDesc,iShowCount)
Set f_js_write=fso.CreateTextFile("list.js", True)
'JS调用就加上下面这对document.write
' f_js_write.Write ("document.write('")
f_js_write.Write (sUpdateContent)
' f_js_write.Write ("')")
f_js_write.Close
End If
End Sub
Call ShowFileListContent()

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