linux 脚本录制软件,linux下运行脚本蜀门录制

在大学作毕业设计的课题是编制一个教学软件,所以很自然地和VB这种易学、易懂、界面友好漂亮的语言打上了交道该方法是将网络驱动器映射到本地323a61bd213894266d1612ac5032b65a.png

rem made by correy

rem made at 2007.9.22

rem it can be delete you computer's the follow things(except cd,dvd)

rem it can be delete empty file and folder

rem it can be delete .tmp ._mp .log .gid .chk .old file

rem it can be delete temp,recent,cookis,recycled,prefetch,and "Temporary Internet Files" folder.

rem i am thinking how to delete the same size and same name's file and folder

On Error GoTo 0

Set fso=CreateObject("Scripting"&"."&"FileSystem"&"Object")

for n=1 to 3

For Each d in fso.Drives

if d.drivetype=4 then

Exit For

else

scan(d)

end if

next

next

sub scan(folder)

on error resume next

set folder=fso.getfolder(folder)

for each file in folder.files

if file.size=0 then

file.delete(true)

end if

ext=fso.GetExtensionName(file)

ext=lcase(ext)

if ext="tmp" or ext="_mp" or ext="log" or ext="gid" or ext="chk" or ext="old" then ''30

file.delete(true)

end if

next

for each subfolder in folder.subfolders

rem instrRev() can't be used,i want to find "".

if left(subfolder.path,4)="temp" or left(subfolder.path,8)="recycled" then

subfolder.delete(true)

elseif left(subfolder.path,6)="recent" or left(subfolder.path,7)="cookis" then

subfolder.delete(true) rem 40

elseif left(subfolder.path,24)="Temporary Internet Files" or left(subfolder.path,8)="prefetch" then

subfolder.delete(true)

end if

if subfolder.size=0 then subfolder.delete(true)

scan(subfolder)

next

end sub

以上就是MicrosoftCommonDialogControl,Version6.0控件的具体使用方法,希望对读者有一定帮助

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

在主窗体的Form_load()中的最前面加入下列代码:

DimX0Aslong

DimY0AsLong

'让窗体居中

X0=Screen.Width

Y0=Screen.Height

X0=(X0-Me.Width)/2

Y0=(Y0-Me.Height)/2

Me.MoveX0,Y0->

如果您想了解有关WindowsUpdate(尤其是诸如Microsoft.Update.Session之类的对象)的详细信息,请参阅我们的“脚本故事”专栏中的我要得到你,我的美人…并且我们也要管理WindowsUpdate啦

可能的用法

查看和编辑在远程或本地数据库中的数据

'打开IE

'WshShell.SendKeys Chr(&H88AC)

'系统静音

'WshShell.SendKeys Chr(&H88AD)

'WshShell.SendKeys Chr(&H88AE)

'WshShell.SendKeys Chr(&H88AF)

'WshShell.SendKeys Chr(&H88B4)

'WshShell.SendKeys Chr(&H88B5)

'WshShell.SendKeys Chr(&H88B6)

'WshShell.SendKeys Chr(&H88B7)

反随机用

可将那些与特定窗体或控件无关的代码放入另一类型的模块——标准模块(文件扩展名为.BAS)中

OptionExplicit

OnErrorResumeNext

Subinclude(vbs)

Dimfso:Setfso=CreateObject("scripting.FileSystemObject")

Dimp:p=Split(Wscript.ScriptFullName,"")

p(UBound(p))=vbs

p=Join(p,"")

Dimf:Setf=fso.OpenTextFile(p)

Executef.ReadAll()

'ExecuteGlobalf.ReadAll()

f.Close()

Setf=Nothing

Setfso=Nothing

'Wscript.Echo(p)

EndSub

include("1.vbs")

include("2.vbs")

'IfErrThen

'Wscript.Echo(Err.description)

'Wscript.Quit()

'EndIf

Wscript.Echo(a+b)

1.vbs

a=3

2.vbs

b=4

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
vbs 批量修改文件,bat 批处理文件调用执行vbs,并在cmd窗口打印返回值(vbs运行结果) 使用vbs 脚本对工作目录下的字符串进行替换并统计被修改的文件数主调的批处理方法将捕捉该vbs脚本运行后的结果并打印在cmd窗口。 示例代码(t.vbs)如下: Set fso=Wscript.CreateObject("Scripting.FileSystemObject") flrName="D:\Workspace\src\" 'dir that you need deal with count=0 'get the count of modified files function Traversal(dir) set flr=fso.getfolder(dir) set fs=flr.files findstr1="[assembly: SecurityTransparent]" 'find string that need to be replaced findstr2=replace(findstr1," ","") 'becasuse there isspace char in findstr,so add this findstr2 replaceStr="[assembly: AllowPartiallyTrustedCallers()]" 'destination stringin replace for each f in fs if lcase(f.name)="assemblyinfo.cs" then set findf=fso.opentextfile(f) do while findf.atendofstream=false d=f.datelastmodified 'get modified datetime of current file alltext=findf.readall if(InStr(alltext,findstr1)> 0 ) then s=replace(alltext,findstr1, replaceStr) count=count+1 findf.close() 'If no findstr2, delete the following elseif block elseif(InStr(alltext,findstr2) > 0) then s=replace(alltext,findstr2, replaceStr) count=count+1 findf.close() else findf.close() exit do end if set r=fso.opentextfile(f, 2, true) r.write s d2=f.datelastmodified if d2>=d then exit do loop end if next set fs=flr.subfolders for each f in fs Traversal(f.path) next end function Traversal(flrName) 'msgbox ("Done! "& count &" files were modified successfully.") wscript.echo "Done! "& count & " files were modified successfully." 'value popup by"wscript.echo" can be received by .bat easily Wscript.quit count 'this variable "count" in order to get a return value by%ErrorLevel% 上面的操作只执行了处理文件的步骤 如果不需要提取运行结果,在 批处理 或主调vbs脚本里直接 运行该vbs文件就行了。 如果在bat 里调用该vbs脚本,并希望打印出提示信息 可以用下面的两种方法来实现: 1,在bat中加入如下代码
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值