Paste Path from Clipboard into TC and go to folder ('CD')

English support forum

Moderators: Hacker, petermad, Stefan2, white

User avatar
Hacker
Moderator
Moderator
Posts: 13141
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

echo y | move c:\windows nul...

cd dirname opens dir in TC.

HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Valentino
Power Member
Power Member
Posts: 709
Joined: 2003-02-07, 00:21 UTC
Location: Ukraine

Post by *Valentino »

Hacker wrote:cd dirname opens dir in TC
What did you want to say :)?
What happens on your TC if you don't use cd?
User avatar
Hacker
Moderator
Moderator
Posts: 13141
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

What happens on your TC if you don't use cd?

Opens Explorer with the dir I specified. W2KPro.

HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Erik_Rasmussen
Junior Member
Junior Member
Posts: 2
Joined: 2003-02-07, 08:53 UTC
Location: Copenhagen, Denmark

Post by *Erik_Rasmussen »

Valentino wrote:2W!ke
OS is WinNT 4 Workstation SP6a. Didn't change shell, nor installed any command line catchers or smth.
Hi - one of my PCs is also running NT4WS-SP6a - on this,
as on my W2K and XP PCs, Explorer is invoked with
the 'argument' as dir, if I just enter, say, "c:\temp" and hit ENTER

Regards
Erik
User avatar
Munango-Keewati
Junior Member
Junior Member
Posts: 31
Joined: 2003-02-19, 18:45 UTC

Paste from Clipboard

Post by *Munango-Keewati »

Thanks to W!ke for pointing me toward vbs. I've never worked with vbs before, but have used vba extensively over the last several years, and it turns out to be fairly close.

What I _really_ wanted to do was copy to the clipboard a drive + path + filename string (in the form C:\path\filename.ext), then have a button or keyboard shortcut set up in TC that would switch one of the directory windows to that directory and locate the file within it.

The following script does all of that on my machine. To work correctly, you have to enable quick search -- letters with dialogue. Of course setups vary a lot in TC, so anyone who wants to try it may need to adjust the script or other settings accordingly. I've only tested it a little, so be cautious; use at your own risk.

Cut the following code and past in a new ASCII document, then save the document under a filename such as paste.vbs. Set up a button bar or keyboard shortcut (not tried yet) to invoke it.

'***************
'Paste filename from clipboard: CD & select file in TC
Set oHtml = CreateObject("htmlfile")
vText = oHtml.ParentWindow.ClipboardData.GetData("text")
If Instr(vText,"\") > 0 then
vPos = InStrRev(vText, "\") + 1
vName = Mid(vText, vPos)
vPos = vPos - 2
vPath = "CD " & Mid(vText, 1, vPos)
set WshShell = WScript.CreateObject("WScript.Shell")
'WshShell.SendKeys "%vr" 'go to right list if using Extended English menu
WshShell.SendKeys "{LEFT}" 'Open/go to command line
WshShell.SendKeys vPath ' change directory
WshShell.SendKeys "~"
WshShell.SendKeys vName 'find file - requires quick search - letters with dialogue
WshShell.SendKeys "{ESC} " 'select file
Else:
MsgBox "No File Path Found on Clipboard."
End If
'*********************
Last edited by Munango-Keewati on 2003-02-25, 22:00 UTC, edited 1 time in total.
User avatar
Munango-Keewati
Junior Member
Junior Member
Posts: 31
Joined: 2003-02-19, 18:45 UTC

Post by *Munango-Keewati »

Just realized that because I'm using the Extended Menu, the following line won't work or may cause problems:

WshShell.SendKeys "%vr" 'go to right list

So I've commented it out above by adding an apostrophe in front of it. If you're using the Extended Menu, remove the apostrophe at the beginning of the line. Or perhaps someone else can suggest a universal means of transfering the focus to the right window.
User avatar
Hacker
Moderator
Moderator
Posts: 13141
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Maybe this would help - http://www.ghisler.ch/board/viewtopic.php?t=271 with cm_focusright or cm_focusleft?

HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Munango-Keewati
Junior Member
Junior Member
Posts: 31
Joined: 2003-02-19, 18:45 UTC

Post by *Munango-Keewati »

Hacker wrote:Maybe this would help - http://www.ghisler.ch/board/viewtopic.php?t=271 with cm_focusright or cm_focusleft?

HTH
Roman
I'm afraid I don't follow this at all:
You can send TC the following command:

wm_InvokeMenuCommand=WM_USER+51

with WPARAM set to the command you want to pass to TC.

What is a wm command? What is WPARAM? How do you send such a command to TC? Could you explain for the novice?

Thanks!
User avatar
Aezay
Senior Member
Senior Member
Posts: 269
Joined: 2003-02-12, 07:27 UTC
Location: Denmark
Contact:

Post by *Aezay »

Munango-Keewati> What is a wm command? What is WPARAM? How do you send such a command to TC? Could you explain for the novice?
Windows API SendMessage/PostMessage will do the trick here. I've made a program that u can use, its very complicated and I suggest that only people with 1337 programming skillz use it: hWnd Monitor.

Christian, is it possible to get a list of the commands TC will respond to? I like the way Winamp has this documented.
Of all the planets I've been to, this one is my favorite.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

See totalcmd.inc ! :)
Author of Total Commander
https://www.ghisler.com
User avatar
Aezay
Senior Member
Senior Member
Posts: 269
Joined: 2003-02-12, 07:27 UTC
Location: Denmark
Contact:

Post by *Aezay »

Ghisler> See totalcmd.inc !
Stupid me! Why didn't I realize this :roll: Thanks!
Of all the planets I've been to, this one is my favorite.
User avatar
Valentino
Power Member
Power Member
Posts: 709
Joined: 2003-02-07, 00:21 UTC
Location: Ukraine

Post by *Valentino »

Guys, you'll be laughing but now my TC opens Explorer from command line!!! :shock: What's happening???!!!?!?!?! :?: Don't understand anything...
User avatar
Hacker
Moderator
Moderator
Posts: 13141
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

You have probably installed a new version of Explorer that changed your "TC opens=" setting in yout TC2Exp.ini file.

HTreallyH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
W!ke98
Junior Member
Junior Member
Posts: 20
Joined: 2005-01-04, 08:30 UTC

Post by *W!ke98 »

Hi All,

I thought let's see if anyone else had a newer/better solution to paste paths into Tcmd and open them in one of the active panes. :)

Greetings Mike.
relloz
Junior Member
Junior Member
Posts: 6
Joined: 2005-01-04, 09:10 UTC
Location: München

Post by *relloz »

W!ke wrote:Christian added the new edit path option in tcmd 5.51, please look at the help how this works.

But pasting paths to the commandline is faster, so you can use the following.
May I describe my present favorite solution?

- I have a path (or a little worse: path\filename in the clipboard)

- I have cm_EditPath on a funtion key like F2

- I press F2 (EditPath) and paste the path into the titlebar ot the panel

- In case I have to edit the path (take away filename): note the great and efficient possibilities of smart higlighting using Ctlr+CursorKeyLeftRight or Ctlr+Shift+CursorKeyLeftRight (special thanks to ghisler for that).

- Return

This works regardless of your QuickSearch settings!


Werner
Post Reply