'=======================================================================
'VBScript Source File -- 获取文件完整路径并存储(拖放操作)
'NAME:获取文件完整路径并存储(拖放操作)
'AUTHOR:Null
'DATE:2008-08-09
'COMMENT:获取文件完整路径并存储(拖放操作)
'=======================================================================
path=left(wscript.scriptfullname,len(wscript.scriptfullname)-len(Wscript.ScriptName))
pwd1="123to999"
pwd2=Left(Wscript.ScriptName,Len(Wscript.ScriptName)-4)
pwd2=Right(pwd2,9)
pwd=pwd1&pwd2
ptxt=path&"\Path.txt"
Set objShell = wscript.CreateObject("Wscript.Shell")
Set fso = wscript.CreateObject("Scripting.FileSystemObject")
Set f=fso.opentextfile(ptxt,8,true)
If wscript.arguments.count=0 then
msgbox "请将需要操作文件拖放到本脚本上即可!",48,"提示"
wscript.quit
end if
for each fname in wscript.arguments
filename=Left(fname,Len(fname)-3)
pwd2=Right(filename,9)
pwd=pwd1&pwd2
cmdname = "cmd.exe /c "
exename = "C:\7-Zip\7z.exe "
paraname = "x -aop"
targetPath =" -o"&filename
f.writeline(filename)
objShell.Run(cmdname & exename & paraname &pwd &" "& fname & targetPath)
Next
f.close
Set objShell = Nothing获取文件完整路径并存储(拖放操作)
最新推荐文章于 2026-06-23 18:54:23 发布
该VBScript脚本通过拖放操作获取文件完整路径,并利用7-Zip进行解压缩,支持批量处理。脚本读取拖放的文件名,生成对应的密码,然后执行解压命令。
932

被折叠的 条评论
为什么被折叠?



