Jump to content

Change Mode

"Copy Path" for XP


TomGL2
 Share

Recommended Posts

MorbidButterfly's "Copy as Path" tip, posted earlier, doesn't apply to Windows XP, but the batch file below adds the feature. The core code is laughably brief (that "copyAsPath" reflects the HTA program user-defined ID).

 

args = Split(copyAsPath.commandLine, chr(34))

Me.clipboarddata.setdata "Text", args(1)

 

The batch file below creates an HTA (HTML Application) file in the Windows folder, and adds the appropriate registry settings.

 

Open Notepad, then copy & paste the following text —

 


@Echo off

Set tgt=%SystemRoot%\CopyPath.HTA

Echo ^<HTA:APPLICATION ID="copyAsPath" windowstate="minimize"/^>> %tgt%

Echo ^<script language="VBScript"^>>> %tgt%

Echo args = Split(copyAsPath.commandLine, chr(34))>> %tgt%

Echo Me.clipboarddata.setdata "Text", args(1)>> %tgt%

Echo Me.Close>> %tgt%

Echo ^</script^>>> %tgt%

Set Key=HKCR\AllFilesystemObjects\shell\Copy Path

Set Val=mshta.exe %SystemRoot%\CopyPath.hta ""%%1""

Reg Add "%Key%\command" /VE /T REG_EXPAND_SZ /D "%Val%" /F > NUL

Reg Add "%Key%" /V Extended /T REG_SZ /F > NUL


Click File and Save As. Type "Make HTA CopyPath.bat" as the file name (including the quotes). Browse to a convenient folder (e.g., Shared Documents) and click Save, then close Notepad.

 

INSTALLATION: Double-click Make HTA CopyPath.bat (administrative rights needed).

 

USAGE: While pressing Shift, right-click a file or folder and click Copy Path. The path (and the filename, if you selected a file) are copied to the clipboard, which you can then paste into a shortcut, post, address bar, etc. It should work for files and folders on your network, too.

Edited by TomGL2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...