获取文件完整路径并存储(拖放操作)

来源:互联网 发布:虚拟座机号码软件 编辑:程序博客网 时间:2024/05/22 06:19
'======================================================================='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&pwd2ptxt=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 thenmsgbox "请将需要操作文件拖放到本脚本上即可!",48,"提示"wscript.quitend iffor each fname in wscript.argumentsfilename=Left(fname,Len(fname)-3)pwd2=Right(filename,9)pwd=pwd1&pwd2cmdname = "cmd.exe /c "exename = "C:\7-Zip\7z.exe "paraname = "x -aop"targetPath =" -o"&filenamef.writeline(filename)objShell.Run(cmdname & exename & paraname &pwd &" "& fname & targetPath)Nextf.closeSet objShell = Nothing

0 0
原创粉丝点击