It is currently Thu Jun 07, 2018 8:56 pm

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  [ 7 posts ] 
Author Message
PostPosted: Fri May 19, 2017 8:05 am 
Offline

Joined: Sat Mar 16, 2013 2:27 pm
Posts: 23
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: 5341
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.

_________________
Links to some general topics:

Compare Start Menus

Read the Search box usage guide.

I am a Windows enthusiast and did Classic Shell's testing and usability/UX feedback.


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

Joined: Sat Mar 16, 2013 2:27 pm
Posts: 23
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: 23
It doesn't work for me for some reason.
Which version of Classic shell I need for that?


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 09, 2017 2:43 pm 
Offline

Joined: Sat Mar 16, 2013 2:27 pm
Posts: 23
I got some help. The following command works for me:
Code:
"C:\Program Files (x86)\ReNamer\ReNamer.exe" /list %3

But I have 2 probelms:
1. Using this command, how do I delete the .tmp file in %temp%?
2. Assume I select the 4 first files of mp3 files folder:

1.mp3
2.mp3
3.mp3
4.mp3

5.mp3
6.mp3
7.mp3

and then I click the "custom button" in Classic Bar - It sends the list to Renamer in this way:

4.mp3
1.mp3
2.mp3
3.mp3

It's not the desired behaviour. The user is expecting to have the order of the files in the list in the same order of the files in the folder, no matter what the order of the selection was (no matter what file selected first/last).


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 10, 2017 6:09 am 
Offline
User avatar

Joined: Thu Jan 03, 2013 12:38 am
Posts: 5341
You can use a batch file to delete the .tmp file and include the Rename command in that batch file.

The file order issue is buggy Windows Explorer behavior I think (of the File Pane). You could try selecting it differently using the mouse or using the keyboard.

_________________
Links to some general topics:

Compare Start Menus

Read the Search box usage guide.

I am a Windows enthusiast and did Classic Shell's testing and usability/UX feedback.


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 10, 2017 7:46 am 
Offline

Joined: Sat Mar 16, 2013 2:27 pm
Posts: 23
Quote:
You can use a batch file to delete the .tmp file and include the Rename command in that batch file.
I have already understood it, but I haven't the scripting knowledge. Do you know what is the code I need to put in the bat file? thanks.
Quote:
The file order issue is buggy Windows Explorer behavior I think (of the File Pane).
Is this something can be fixed by Classic Shell? (Feature Request)


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

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Baidu [Spider] and 4 guests


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.