|
pinghu
中级用户
  
积分 307
发帖 130
注册 2008-2-1
状态 离线
|
『楼 主』:
如何实现用右键菜单调用bat文件完成移动文件的功能
使用 LLM 解释/回答一下
功能1:当鼠标右键选中若干个文件和文件夹时,右键菜单中出现“移动至父目录”命令,执行的结果为将选中的文件和文件夹移动至父目录。如存在文件重名现象就自动重命名
功能2:当鼠标右键选中若干个文件夹时,右键菜单中出现“脱壳”命令,执行的结果为将选定文件夹中的所有内容移动至当前目录然后删除所选文件夹。如存在文件重名现象就自动重命名
我用的是xp,这两个功能如果能实现的话是很有用的。问题有些难,还望大家研究研究!
如果能写出bat单文件实现这两个功能那我会佩服的五体投地,单文件实现不了的话。用bat和reg组合起来也不错啊。有劳大家了
Function 1: When multiple files and folders are selected with the right mouse button, the "Move to Parent Directory" command appears in the right-click menu. The result of execution is to move the selected files and folders to the parent directory. If there is a file name conflict, it will be automatically renamed.
Function 2: When multiple folders are selected with the right mouse button, the "Unpack" command appears in the right-click menu. The result of execution is to move all contents in the selected folder to the current directory and then delete the selected folder. If there is a file name conflict, it will be automatically renamed.
I am using XP. If these two functions can be realized, it will be very useful. The problem is a bit difficult, and I hope everyone can study it! If someone can write a single BAT file to realize these two functions, I will be extremely impressed. If a single BAT file cannot be realized, it is also good to use a combination of BAT and reg. Thank you everyone!
|
|
2008-2-4 16:51 |
|
|
slore
铂金会员
      
积分 5212
发帖 2478
注册 2007-2-8
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
重命名麻烦点。。。移动不难。
Renaming is a bit troublesome... Moving is not difficult.
|
|
2008-2-4 17:37 |
|
|
pinghu
中级用户
  
积分 307
发帖 130
注册 2008-2-1
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
难就难在若何保证重命名后又不至于和其他文件重名是吗
The difficulty is whether it is to ensure that after renaming, it will not conflict with other files, right?
|
|
2008-2-5 11:14 |
|
|
3742668
荣誉版主
      
积分 2013
发帖 718
注册 2006-2-18
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
单个文件实现并不难,只不过体力活都懒得去做而已。
建议你学习一下 无奈何 的sendto+,以及本版多次讨论过的 右键菜单 的问题,应该很简单就能实现。
It's not difficult to implement a single file, it's just that I'm too lazy to do the manual work. It is suggested that you learn about Wunaaihe's sendto+, as well as the right-click menu issues that have been discussed many times in this forum. It should be very simple to implement.
|
|
2008-2-5 11:41 |
|
|
pinghu
中级用户
  
积分 307
发帖 130
注册 2008-2-1
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
楼上说的帖子我找不着啊,哪位能给个引用地址
I can't find the post mentioned upstairs. Can someone give a reference address?
|
|
2008-2-5 19:31 |
|
|
pinghu
中级用户
  
积分 307
发帖 130
注册 2008-2-1
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
假设我选定文件的时候
用%1表示该文件,用cd %~dp1命令进入该文件夹,接下来我用xcopy /s/q/-y %1 ..\复制文件的时候出现找不到文件的情况怎么处理呢?
Suppose when I select the file, I use %1 to represent the file, and use the command cd %~dp1 to enter the folder. Then when I use xcopy /s/q/-y %1 ..\ to copy the file, there is a situation where the file is not found. How to handle it?
|
|
2008-2-5 19:49 |
|
|
slore
铂金会员
      
积分 5212
发帖 2478
注册 2007-2-8
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
为什么不用move?
你的文件路径是不是有空格?
Why not use move?
Is your file path has space?
|
|
2008-2-5 19:55 |
|
|
pinghu
中级用户
  
积分 307
发帖 130
注册 2008-2-1
状态 离线
|
|
2008-2-5 20:17 |
|
|
pinghu
中级用户
  
积分 307
发帖 130
注册 2008-2-1
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
我只会用xcopy加rd,move怎么加参数表示指定路径下所有文件和文件夹呢
How to use the move command with parameters to specify all files and folders under a specified path?
|
|
2008-2-5 20:20 |
|
|
slore
铂金会员
      
积分 5212
发帖 2478
注册 2007-2-8
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
应该是*.*
有空格你要引起来……
在你脚本不要直接执行,最好先echo看看。。。
It should be *.*.
If there are spaces, you need to enclose it in quotes...
Don't execute it directly in your script, it's better to echo it first...
|
|
2008-2-5 20:35 |
|
|
pinghu
中级用户
  
积分 307
发帖 130
注册 2008-2-1
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
选定文件的时候调用%1却返回空值,为什么啊。郁闷啊,不能给全代码,至少给点提示啊
When selecting a file, the call to %1 returns an empty value. Why is that?郁闷啊,can't give the full code, at least give some hints啊
|
|
2008-2-5 20:57 |
|
|
pinghu
中级用户
  
积分 307
发帖 130
注册 2008-2-1
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
看来各位还未重视我的帖子,我想是因为大家认为难就难在重命名上面,移动文件看起来很容易,等你亲自测试的时候就会发现,当选中若干文件时,在注册表命令行中调用一个bat文件,bat不知道你选的文件是什么,%1在这里不起作用。你就没办法继续下去。有意思的是当选定目录时%1却可以返回当前路径,也就是说,第二个功能实现起来要比第一个功能容易(暂时不考虑重命名)如果问题换成“在右键菜单中加入cmd或者格式化什么的,我也不用大费周章的来这里提问了
It seems that everyone hasn't attached importance to my post yet. I think it's because everyone thinks the difficulty lies in renaming. Moving files seems very easy. When you test it personally, you will find that when you select several files, call a bat file in the registry command line, the bat doesn't know what files you selected, and %1 doesn't work here. Then you can't continue. Interestingly, when a directory is selected, %1 can return the current path. That is to say, the second function is easier to implement than the first function (temporarily not considering renaming). If the problem is changed to "adding cmd or formatting in the right-click menu, I wouldn't bother to come here to ask questions."
|
|
2008-2-5 21:48 |
|
|
pinghu
中级用户
  
积分 307
发帖 130
注册 2008-2-1
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
问题不解决之前,我不想让帖子沉下去,解决问题的同时也会得到其中的乐趣啊
Before the problem is solved, I don't want the post to sink. The fun can also be obtained while solving the problem.
|
|
2008-2-5 22:17 |
|
|
slore
铂金会员
      
积分 5212
发帖 2478
注册 2007-2-8
状态 离线
|
|
2008-2-5 22:36 |
|
|
slore
铂金会员
      
积分 5212
发帖 2478
注册 2007-2-8
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
临时用空间上传了下。
不能看到图的话,我在找找地址好了……
论坛的上传系统太郁闷了~~
Temporarily uploaded it to the space.
If you can't see the picture, I'll find the address again...
The forum's upload system is too frustrating~
|
|
2008-2-5 22:39 |
|