本想给你写批处理来着,但是总觉得批处理不够完美,特别是快捷方式图标
下面是vbs的,把文件拖放到vbs文件上
On Error Resume Next
Set WS = CreateObject("WScript.Shell")
If WScript.Arguments.Count = 0 Then WScript.Quit
aFile = WScript.Arguments(0)
Set Fso = CreateObject("Scripting.FileSystemObject")
Set f = Fso.GetFolder(aFile)
If Err.Number <> 0 Then
Set f = Fso.GetFile(aFile)
aLinkName = Mid(f.Name,1,InStrRev(f.Name,".")-1) :aName = f.Name
Else
aLinkName = f.Name :aName = f.Name
End If
aFolder = "E:\影库\"
bFolder = "D:\电影\"
If Fso.FolderExists(aFolder) = False Then Fso.CreateFolder(aFolder)
If Fso.FolderExists(bFolder) = False Then Fso.CreateFolder(bFolder)
Fso.MoveFile aFile, aFolder
With WS.CreateShortcut( bFolder& aLinkName & ".lnk")
.TargetPath = aFolder & aName
.WindowStyle = 1
.WorkingDirectory = aFolder
.Save
End With
把下面代码保存为批处理。
使用方法:(不用运行该批处理)只需把影片拖到该批处理的图标上即可。
copy "%1" E:\影库
set fn=%~nx1
del "%1"
echo [InternetShortcut] >"D:\电影\%fn%.url"
echo URL="E:\影库\%fn%" >>"D:\电影\%fn%.url"