It is currently Thu Jun 22, 2017 11:33 am

All times are UTC - 8 hours [ DST ]


Forum rules


Please, keep discussions on topic and in the right forum. The start menu topics go into the Classic Start Menu forum, etc. This makes it easier for people to locate topics they are looking for.
If you get a satisfactory response to your question, please mark the topic as "solved". Click the green √ button in the bottom-right of the post.



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Fri May 19, 2017 8:05 am 
Offline

Joined: Sat Mar 16, 2013 2:27 pm
Posts: 20
I wanted to send folders/files selected to Renamer by Classic Explorer button
http://www.den4b.com/forum/viewtopic.php?id=2312


Top
 Profile  
Reply with quote  
PostPosted: Sat May 20, 2017 12:28 pm 
Offline
User avatar

Joined: Thu Jan 03, 2013 12:38 am
Posts: 5049
You can use the following placeholders in a Custom button's Command or Link field:

◦%1 is the path of the current folder. Keep in mind that if the current folder is a root of a drive it will end with a backslash (like C:\)

◦%2 is the path of the selected file (only when a single file is selected). Does not work for multiple selected files

◦%3 is a name of a temporary text file that contains all selected files. Each line in the text file contains one file with its full path. Meaning you will have to first output multiple selected files to a temporary text file in %tmp% for example.

◦%4 is the same as %3, but the file is in Unicode (UTF16) format. The file contains no byte order mark. %3 and %4 can't both be used by the same command

Note to developers: When %3 or %4 is used, it is the responsibility of the command to delete the temporary file when it finishes. Otherwise the temp file will be left behind and waste disk space. Also if the command is a console application or a batch file it will be launched in silent mode with no console window


◦%5 is a name of a temporary text file, which can be used to return a command back to Classic Explorer. If the first 2 bytes of the file are 255 and 254, the file is treated as Unicode. Only one command can be used at a time. The command can be:
◾open <folder name> - causes Explorer to navigate to the given folder
◾select <list of file names> - selects the given files, deselects the rest. The file names must be separated by a tab or a newline character. The files should not contain a path. If they do, the path will be ignored

◾refresh - refreshes Explorer
◦Note to developers: commands using %5 will run in silent mode (like commands using %3 or %4) but also Explorer will wait for the process to finish. The process must finish as quickly as possible, because Explorer will be frozen during the execution of the command

****************************************************************************
An example:

Copy selected files to the parent folder

Create a batch file called C:\CopyParent.bat:
set list=%1
set list=%list:"=%
for /F "delims=" %%i in (%list%) do copy /Y "%%i" ..
del %1

Use this command: C:\CopyParent.bat "%3". %3 will be replaced by a text file containing the full names of all selected files. The batch file will read each line of that text file, and copy each of the selected files to the parent folder. At the end the batch file deletes the initial temp file. The first two set commands remove the quotes from the %1 parameter.

_________________
Compare Start Menus

Read the Search box usage guide.

I am a Windows enthusiast and Classic Shell tester.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 04, 2017 5:10 am 
Offline

Joined: Sat Mar 16, 2013 2:27 pm
Posts: 20
I guess I need to use %4 in my case.
Unfortunately I don't have enough experience with batch scripting.
Can I get help with this?
How to make correctly the batch file for sending selected folders&files to a program?
thanks in advance.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 13, 2017 5:03 am 
Offline

Joined: Sat Mar 16, 2013 2:27 pm
Posts: 20
It doesn't work for me for some reason.
Which version of Classic shell I need for that?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group, Almsamim WYSIWYG Classic Shell © 2010-2016, Ivo Beltchev.
All right reserved.