[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
什么系统的?WIN7的非administrateR 用户比XP处理起来要麻烦
---学无止境---

TOP

winxp系统就容易很多了。
使用步骤:
1.把下面的VBS保存为 d盘.vbs,然后右键->复制
2.运行->输入"sendto"->确定
3.在打开的文件夹中右键->粘贴快捷方式

这样右键->发送到  就会多了一个选项,使用即可

注意,如果要发送到以他地方,把VBS中的  "d:\" 改为你相应的目录即可,最后一定要有 \
  1. '保存我为 d盘.vbs
  2. Dim objArgs,fso,strText,fileName,extName,destPath
  3. destPath = "d:\" '发送到d:\
  4. Set objArgs = WScript.Arguments
  5. If objArgs.Count = 0 Then WScript.Quit
  6. strText = CreateObject("htmlfile").ParentWindow.ClipboardData.GetData("text")
  7. '剪贴板的内容为空就退出
  8. If strText = "" Then WScript.Quit
  9. Set fso = CreateObject("SCripting.FileSystemObject")
  10. If fso.FileExists(objArgs.Item(0)) Then
  11. extName = fso.GetExtensionName(objArgs.Item(0))
  12. If fso.FileExists(strText & "." & extName) Then
  13. fileName = strText & "1." & extName
  14. Else
  15. fileName = strText & "." & extName
  16. End If
  17. fso.CopyFile objArgs.Item(0),destPath & fileName
  18. ElseIf fso.FolderExists(objArgs.Item(0)) Then
  19. If fso.FolderExists(strText) Then
  20. fileName = strText & "1"
  21. Else
  22. fileName = strText
  23. End If
  24. fso.CopyFolder objArgs.Item(0),destPath & fileName
  25. End If
  26. Set fso = Nothing
  27. Set objArgs = Nothing
复制代码
---学无止境---

TOP

理解错误
  1. Dim objArgs,fso,f,strText,fileName,extName
  2. Set objArgs = WScript.Arguments
  3. If objArgs.Count = 0 Then WScript.Quit
  4. strText = CreateObject("htmlfile").ParentWindow.ClipboardData.GetData("text")
  5. '剪贴板的内容为空就退出
  6. If strText = "" Then WScript.Quit
  7. Set fso = CreateObject("SCripting.FileSystemObject")
  8. If fso.FileExists(objArgs.Item(0)) Then
  9.         extName = fso.GetExtensionName(objArgs.Item(0))
  10.         If fso.FileExists(strText & "." & extName) Then
  11.                 fileName = strText & "1." & extName
  12.         Else
  13.                 fileName = strText & "." & extName
  14.         End If
  15.         Set f = fso.GetFile(objArgs.Item(0))
  16.         f.Name = fileName
  17. ElseIf fso.FolderExists(objArgs.Item(0)) Then
  18.         If fso.FolderExists(strText) Then
  19.                 fileName = strText & "1"
  20.         Else
  21.                 fileName = strText
  22.         End If
  23.         Set f = fso.GetFolder(objArgs.Item(0))
  24.         f.Name = fileName
  25. End If
  26. Set fso = Nothing
  27. Set f = Nothing
  28. Set objArgs = Nothing
复制代码
---学无止境---

TOP

返回列表