'======================================================================= '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
获取文件完整路径并存储(拖放操作)
最新推荐文章于 2023-12-09 11:09:57 发布