New command to execute batchfiles from the clipboard
Moderators: Hacker, petermad, Stefan2, white
New command to execute batchfiles from the clipboard
Something that I do quite regularly, is to select a range of files in Total Commander and then copy/paste their names into my text editor to create a batch file.
(using the cm_CopyFullNamesToClip command, through a button, which copies the full names of the selected files to the clipboard).
However, when I have finished editing this batchfile, I have to give it a name, save it in the correct folder, execute it, and then delete it afterwards.
It would be much easier if I could just copy my finished batchfile to the clipboard, and then tell Total Commander to execute it from there..
Any supporters? :)
Regards,
-Daan-
(using the cm_CopyFullNamesToClip command, through a button, which copies the full names of the selected files to the clipboard).
However, when I have finished editing this batchfile, I have to give it a name, save it in the correct folder, execute it, and then delete it afterwards.
It would be much easier if I could just copy my finished batchfile to the clipboard, and then tell Total Commander to execute it from there..
Any supporters? :)
Regards,
-Daan-
#5050 :: Everyone who believes in telekinesis, raise my hand!
- sqa_wizard
- Power Member
- Posts: 3896
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
- ghisler(Author)
- Site Admin
- Posts: 50873
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
You can try my makebat plugin: It creates one or more lines in a batch file for each selected file, and then stores the batch for execution.
You can find it here:
http://www.ghisler.com/plugins.htm
You can find it here:
http://www.ghisler.com/plugins.htm
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- Balderstrom
- Power Member
- Posts: 2148
- Joined: 2005-10-11, 10:10 UTC
Or a simple AHK script instead of batch.
Command:%USERPROFILE%\Documents\AutoHotkey\TC_AHKRun.ahk
Parameters: notepad.exe %UL
Which doesn't suffer from batch/cmd's mishandling of quotes or unicode.
Command:%USERPROFILE%\Documents\AutoHotkey\TC_AHKRun.ahk
Parameters: notepad.exe %UL
Code: Select all
;
; TC_AHKRun.ahk
;
command=%1%
inputFile=%2%
Loop, Read, %inputFile%
{
Run, %command% %A_LoopReadLine%
fileList:=fileList "`n" A_LoopReadLine ; Example to append the lines of input file into a list.
}
MsgBox, %fileList% ; Output the example List
Hi Christian!
Thanks for the suggestion of using Makebat, but its workflow doesn't improve much upon my current method (of using cm_CopyFullNamesToClip, then pasting the filenames into my text editor and saving it as a batchfile).
The reason why I suggested an internal solution is because ultimately, Total Commander's purpose is to make life easier for people who deal with files a lot. With basic tasks like Copy or Move or Change Properties, it does an excellent job both for single and multiple files. However, for more 'exotic' purposes (e.g. running Grep, Cacls, Exiftool or other command line tools on a number of files) there's only the command line, which is not very practical for multi-file operations. So, that is what I feel is still missing in Total Commander: easier non-standard processing of multiple files.
What I requested above -the ability to simply paste a batch of commands into TC, which it then executes- would be a nice help. I made another (better) suggestion that would basically serve the same purpose by making the command line multi-file capable by repeating the command for each selected file. See http://www.ghisler.ch/board/viewtopic.php?t=34402.
However, an even nicer way of improving TC's multi-file capabilities might be to offer the user a Batch Builder. It could look similar to the Multi Rename Tool, in that it would take the selected files and show them as a list. You could then enter (or browse to) a command that is inserted before each filename, and a parameter that is added behind each filename, and then you would simply push 'Run' to execute the batch. I can think of a few useful options (e.g. use full pathnames; execute from: current / parent / program / other folder; protect against too long command lines; keep CMD window open; redirect output to textfile; save as template, etc) but in all, it would seem fairly easy to implement and I think it would help many users to save a lot of time.
Balderstrom: I really appreciate your comments and effort to help me, but I'm not looking for technical support, nor for external kludges. It's simply a suggestion for Christian's consideration (and for others to say Yes or Nay, or to tag on with further ideas) and I hope this message made it clear why I believe that better multiple-file capabilities deserve a place in the Commander itself.
Thanks for the suggestion of using Makebat, but its workflow doesn't improve much upon my current method (of using cm_CopyFullNamesToClip, then pasting the filenames into my text editor and saving it as a batchfile).
The reason why I suggested an internal solution is because ultimately, Total Commander's purpose is to make life easier for people who deal with files a lot. With basic tasks like Copy or Move or Change Properties, it does an excellent job both for single and multiple files. However, for more 'exotic' purposes (e.g. running Grep, Cacls, Exiftool or other command line tools on a number of files) there's only the command line, which is not very practical for multi-file operations. So, that is what I feel is still missing in Total Commander: easier non-standard processing of multiple files.
What I requested above -the ability to simply paste a batch of commands into TC, which it then executes- would be a nice help. I made another (better) suggestion that would basically serve the same purpose by making the command line multi-file capable by repeating the command for each selected file. See http://www.ghisler.ch/board/viewtopic.php?t=34402.
However, an even nicer way of improving TC's multi-file capabilities might be to offer the user a Batch Builder. It could look similar to the Multi Rename Tool, in that it would take the selected files and show them as a list. You could then enter (or browse to) a command that is inserted before each filename, and a parameter that is added behind each filename, and then you would simply push 'Run' to execute the batch. I can think of a few useful options (e.g. use full pathnames; execute from: current / parent / program / other folder; protect against too long command lines; keep CMD window open; redirect output to textfile; save as template, etc) but in all, it would seem fairly easy to implement and I think it would help many users to save a lot of time.
Balderstrom: I really appreciate your comments and effort to help me, but I'm not looking for technical support, nor for external kludges. It's simply a suggestion for Christian's consideration (and for others to say Yes or Nay, or to tag on with further ideas) and I hope this message made it clear why I believe that better multiple-file capabilities deserve a place in the Commander itself.
#5050 :: Everyone who believes in telekinesis, raise my hand!
Re: New command to execute batchfiles from the clipboard
Did you get a look at TCBL ?CopyCats wrote:Something that I do quite regularly, is to select a range of files in Total Commander and then copy/paste their names into my text editor to create a batch file.
(using the cm_CopyFullNamesToClip command, through a button, which copies the full names of the selected files to the clipboard).
However, when I have finished editing this batchfile, I have to give it a name, save it in the correct folder, execute it, and then delete it afterwards.
It would be much easier if I could just copy my finished batchfile to the clipboard, and then tell Total Commander to execute it from there..
Any supporters?
Regards,
-Daan-
See http://ghisler.ch/board/viewtopic.php?t=9374 and/or http://tccfestuff.free.fr/
It is written exactly for this purpose, ability to build bat from file list and execute it afterwards deleting automatically the script. It even allows you to launch an editor to polish your script before execution. It also let the clipboard untouched !
Some open source Ahk solutions are similar and works great !