用Nircmd轻松复制文件(文件夹)的完整路径
http://429006.com/article/technology/555.htm
pop:转载于鬼仔的blog,自己简单的编辑了一下,更加简洁和完整了。
复制文件的完整路径通常情况先要复制文件的所在路径,还要复制文件的名称。然后将这两部分合在一起,非常的麻烦其实可以通过一款名字为“Nircmd”的软件来实现一键复制,它是个小巧但很强大的命令行工具,这样获取文件路径就会方便很多。
先下载“Nircmd”(下载地址:http://www.onlinedown.net/soft/44565.htm),然后解压到X:\windows\system32目录下,接下来需要将下面代码保存为*.reg文件,然后双击导入即可。其内容如下:
“复制文件路径”注册表文件内容:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\copypath]
@="复制文件路径到剪贴板"
[HKEY_CLASSES_ROOT\*\shell\copypath\command]
@="nircmd.exe clipboard set \"%1\""
“复制文件夹路径”注册表文件内容:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\copypath]
@="复制文件夹路径到剪贴板"
[HKEY_CLASSES_ROOT\Directory\shell\copypath\command]
@="nircmd.exe clipboard set \"%l\""
以后再获取文件完整路径的时候,在文件上按鼠标右键,就会看到多出一个“复制文件路径到剪贴板”选项(同样也适用于文件夹,在选择文件夹的时候就显示“复制文件夹路径到剪贴板”),选择这项之后就将文件完整路径进行复制,最后就可以粘贴所需要的地方。
pop补充:其实nircmd不仅仅只有这些功能,打开“NirCmd.chm”将会有更多的介绍。
Examples of what you can do with NirCmd:
Open the door of J: CD-ROM drive | nircmd.exe cdrom open j: |
Close the door of Y: CD-ROM drive | nircmd.exe cdrom close y: |
Increase the system volume by 2000 units (out of 65535) | nircmd.exe changesysvolume 2000 |
Decrease the system volume by 5000 units (out of 65535) | nircmd.exe changesysvolume -5000 |
Set the volume to the highest value | nircmd.exe setsysvolume 65535 |
Mute the system volume | nircmd.exe mutesysvolume 1 |
Unmute the system volume | nircmd.exe mutesysvolume 0 |
Switch the system volume between the mute and normal state. | nircmd.exe mutesysvolume 2 |
Create a shortcut on your desktop that switch the system volume between the mute and normal state. | nircmd.exe cmdshortcut "~$folder.desktop$" "Switch Volume" mutesysvolume 2 |
Turn off the monitor | nircmd.exe monitor off |
Start the default screen saver | nircmd.exe screensaver |
Put your computer in 'standby' mode | nircmd.exe standby |
log off the current user | nircmd.exe exitwin logoff |
Ask if you want to reboot, and if you answer 'Yes', reboot the computer. | nircmd.exe qboxcom "Do you want to reboot ?" "question" exitwin reboot |
Turn off your computer | nircmd.exe exitwin poweroff |
Turn off all computers specified in computers.txt ! | multiremote copy "c:\temp\computers.txt" exitwin poweroff force |
Dial to "My Internet" connection | nircmd.exe rasdial "My Internet" |
Disconnect the "My Internet" connection | nircmd.exe rashangup "My Internet" |
Make your Internet Explorer windows 75% transparent ! (192 / 256) | nircmd.exe win trans ititle "internet explorer" 192 |
Minimize all your Internet Explorer windows | nircmd.exe win min class "IEFrame" |
Close all your Internet Explorer windows | nircmd.exe win close class "IEFrame" |
Close all your Explorer windows (My Computer, folders, and so on) | nircmd.exe win close class "CabinetWClass" |
Hide all your Internet Explorer windows | nircmd.exe win hide class "IEFrame" |
Show all your Internet Explorer windows (after you made them hidden with previous example) | nircmd.exe win show class "IEFrame" |
Center all top-level windows | nircmd.exe win center alltop |
Remove the title bar of My Computer window. | nircmd.exe win -style title "my computer" 0x00C00000 |
Return the title bar of My Computer window that we removed in the previous example. | nircmd.exe win +style title "my computer" 0x00C00000 |
Set the My Computer window to right-to-left order (For hebrew and arabic languages) | nircmd win +exstyle title "my computer" 0x00400000 |
Set all child windows of My Computer window to right-to-left order (For hebrew and arabic languages) | nircmd win child title "my computer" +exstyle all 0x00400000 |
Create a shortcut on your desktop that closes all your Internet Explorer windows | nircmd.exe cmdshortcut " "~$folder.desktop$ "Close All IE" win close class "IEFrame" |
Create a shortcut on your desktop that hides all your Internet Explorer windows | nircmd.exe cmdshortcut " "~$folder.desktop$ "Hide All IE" win hide class "IEFrame" |
Create a shortcut on your desktop that shows back all your Internet Explorer windows | nircmd.exe cmdshortcut " "~$folder.desktop$ "Show All IE" win show class "IEFrame" |
Set the Windows Calculator as top-most window (above all other windows) | nircmd.exe win settopmost title "Calculator" 1 |
Set the Windows Calculator back to regular window (non top-most window) | nircmd.exe win settopmost title "Calculator" 0 |
Create a shortcut to Windows calculator under Start Menu->Programs->Calculators | nircmd.exe shortcut "f:\winnt\system32\calc.exe" "~$folder.programs$\Calculators" "Windows Calculator" |
Hide the desktop window | nircmd.exe win hide class progman |
Show the desktop window (After hiding it in previous example) | nircmd.exe win show class progman |
Hide the start button on the system tray | nircmd.exe win child class "Shell_TrayWnd" hide class "button" |
Show the start button on the system tray | nircmd.exe win child class "Shell_TrayWnd" show class "button" |
Hide the clock on the system tray | nircmd.exe win child class "Shell_TrayWnd" hide class "TrayClockWClass" |
Show the clock on the system tray | nircmd.exe win child class "Shell_TrayWnd" show class "TrayClockWClass" |
Kill (terminate) all instance of Internet Explorer processes | nircmd.exe killprocess iexplore.exe |
Create a shortcut on your desktop that opens the door of K: CDROM drive when you run it. | nircmd.exe cmdshortcut "~$folder.desktop$" "Open CDROM" cdrom open k: |
Create a shortcut to NirSoft Web site on your desktop | nircmd.exe urlshortcut "http://www.nirsoft.net" "~$folder.desktop$" "NirSoft" |
Add NirSoft Web site to your Favorities under Links folder. | nircmd.exe urlshortcut "http://www.nirsoft.net" "~$folder.favorites$\Links" "NirSoft" |
Create a shortcut to NirSoft Web site on the desktop of all computers listed in computers.txt | nircmd.exe multiremote copy "c:\temp\computers.txt" urlshortcut "http://www.nirsoft.net" "~$folder.common_desktop$" "NirSoft" |
Set the display mode to 800x600x24bit colors | nircmd.exe setdisplay 800 600 24 |
Create a shortcut on the desktop that set the display mode to 800x600x24bit colors | nircmd.exe cmdshortcut "~$folder.desktop$" "800x600x24" setdisplay 800 600 24 |
Copy all shortcuts on your desktop to another folder (f:\temp\desktop). | nircmd.exe execmd copy "~$folder.desktop$\*.lnk" f:\temp\desktop |
Restart your Apache server (under Windows NT/2000/XP/2003) | nircmd.exe service restart apache |
Create a shortcut on your desktop that restarts the Apache server | nircmd.exe cmdshortcut "~$folder.desktop$" "Restart Apache" service restart apache |
Restart your IIS | nircmd.exe service restart w3svc |
Restart MySql | nircmd.exe service restart MySql |
Open the desired Registry key/value in RegEdit | nircmd.exe regedit "HKLM\Software\Microsoft\Windows\CurrentVersion" "CommonFilesDir" |
Open the Registry key that you copied to the clipboard in RegEdit. | nircmd regedit "~$clipboard$" |
Disable the screen saver | nircmd.exe regsetval sz "HKCU\control panel\desktop" "ScreenSaveActive" 0 |
Enable the screen saver | nircmd.exe regsetval sz "HKCU\control panel\desktop" "ScreenSaveActive" 1 |
Change the date/time of the specified filename (creation time and modified time) | nircmd.exe setfiletime "c:\temp\myfile.txt" "24-06-2003 17:57:11" "22-11-2005 10:21:56" |
Copy your desktop folder path to the clipboard | nircmd.exe clipboard set ~$folder.desktop$ |
Copy your start menu folder path to the clipboard | nircmd.exe clipboard set ~$folder.start_menu$ |
Copy the content of info1.txt (simple text file) to the clipboard | nircmd.exe clipboard readfile "c:\My Files\info1.txt" |
Add the text content of clipboard to info1.txt | nircmd.exe clipboard addfile "c:\My Files\info1.txt" |
Clear the clipboard | nircmd.exe clipboard clear |
Create all folders specified in "c:\temp\folders.txt". The folder path names are separated by CRLF characters. | nircmd.exe paramsfile "c:\temp\folders.txt" "" "" execmd md ~$fparam.1$ |
Install the specified .NET assembly in the global assembly cache (like gacutil) | nircmd.exe gac install "C:\temp\MyAssembly\bin\MyAssembly.dll" |
Empty the recycle bin in all drives. | nircmd.exe emptybin |
Answer 'Yes' to a standard Windows message-box. | nircmd.exe dlg "" "" click yes |
用Nircmd轻松复制文件(文件夹)的完整路径相关推荐
- windows复制文件路径_如何在Windows 10上复制文件的完整路径
windows复制文件路径 Sometimes, it's handy to copy the full path of a file or folder in Windows 10 to the c ...
- Java学习踩坑:阿里云OSS文件上传前端通过路径获取报403错误
错误还原:我在做OSS文件上传头像时,发现头像的图片文件可以上传成功,也可以返回文件的路径.但是前端在拿着后端返回的文件图片路径去访问这个图片时,Response中的错误码为403.找了一下网上的资料 ...
- python读取、写入、移动、复制文件(夹)以及其他关于文件(夹)的操作
文章目录 基础操作 判断文件或者目录是否存在 创建目录 连接两个路径成为一个路径 读取文件 写入文件 移动文件(夹) 复制文件(夹) 突然发现,经常需要进行文件操作,因为如果程序运行时间很长,我们需要 ...
- C++学习之:复制和粘贴文件/文件夹
从剪贴板上获得要复制/剪贴的文件路径之后,如何完成文件/文件夹的粘贴呢.下面列出了两个函数用来完成这些功能 //复制的粘贴 DWORD VrvCopyFile( LPCWSTR lpSrc, LPCW ...
- golang 文件 文件夹 创建 读取 移动 复制 写入 遍历
目录 文件读取 创建 写入 移动 拷贝 删除 文件 创建文件夹 文件覆盖判断 遍历文件夹 权限 文件操作, 大体分为两部分: os库 : 文件\文件夹创建,读取,移动,复制 io库 : 文件内容的写入 ...
- php递归复制文件内容,PHP实现递归复制整个文件夹的类实例_php技巧
本文实例讲述了PHP实现递归复制整个文件夹的类.分享给大家供大家参考.具体如下: CreateFolder($toFile); $folder1=opendir($fromFile); while($ ...
- 怎么复制远程服务器上的文件夹,Linux系统复制文件/文件夹到远程服务器
从一个服务器复制文件到另一个服务器,或者从本地到远程复制是 Linux 管理员的日常任务之一. 我觉得不会有人不同意,因为无论在哪里这都是你的日常操作之一.有很多办法都能处理这个任务,我们试着加以概括 ...
- 复制一个文件夹中的所有文件和文件夹的java程序实现
使用java程序实现了对文件夹的复制功能: package demo.io; import java.io.BufferedInputStream; import java.io.BufferedOu ...
- php复制整个文件夹,PHP实现递归复制整个文件夹的类实例
本文实例讲述了PHP实现递归复制整个文件夹的类.分享给大家供大家参考.具体如下: /* * 文件夹复制类 */ class CopyFile { public $fromFile; public $t ...
最新文章
- 5G NGC — UDM 统一数据管理
- 在Windows上使用终端模拟程序连接操作Linux以及上传下载文件
- mysql 连接查询两个条件_MySQL之多表查询一 介绍 二 多表连接查询 三 符合条件连接查询 四 子查询 五 综合练习...
- Python 常见语法逻辑错误收集
- 康奈尔ECE MEng项目拒信+1 哈哈哈
- 通信大数据应用未来还有很大的想象空间
- Qt 数据库操作(二)
- 如何使得账户密码永不过期
- oracle视图查询机制,物化视图及日志内部机制的一点研究
- Eclipse build Android时不生成apk问题解决方法
- python怎么开始打代码_Python代码写好了怎么运行?
- oracle中怎么建立日志表,怎么在Oracle中创建一个错误日志表
- java编程题全集及答案_JAVA编程题全集(100题及答案)q
- SeetaFace6人脸库体验(全部开源)
- displayTag获得行号
- php中如何从键盘获取,在javascript中如何获取键盘的keyCode
- 转换加密的WMV文件让所其它播放器可以放
- 河南省普通高中学业水平测试计算机,河南省普通高中信息技术学业水平测试综合测试题3(有答案)...
- 国科大学习资料--多媒体分析与理解(卢汉请)-2019期末考试题
- IOS开发入门之二——第一个App