| Classic Shell http://www.classicshell.net/forum/ |
|
| Classic Explorer - Custom Toolbar Button Help http://www.classicshell.net/forum/viewtopic.php?f=8&t=388 |
Page 1 of 1 |
| Author: | w.a.y.n.e [ Sat Mar 16, 2013 7:24 am ] |
| Post subject: | Classic Explorer - Custom Toolbar Button Help |
Hi Guys, I need a little help with this one, basically, i need to know how to pass the currently selected file to an exe for processing. The purpose of my request - to be able to select a rar file within a folder, click the button and have it extract the contents to the current directory, maintaining internal folder/path structure within the RAR file. so, utilising the help found here... http://acritum.com/software/manuals/winrar/ I have the following...... "%SystemDrive%\Program Files\WinRAR\WinRAR.exe" x *.rar *.* where "x" is the unpack instruction *.rar limits the extraction process to RAR files - this is only needed because currently i can't identify a single file/file set, for extraction, and wihtout this it tries to extract from par2 files and srr files !! *.* tells it all fiels in the archive. now, ideally i'd like it to delete the rar files once unpacked without error, but i'll get to that later, as i will the drop down menu choice of extract here or extract to folder named as per the archive. For now, i need to work out how to send only the file i want unpacking to WinRAR, i was thinnking it would be somethig like this "%SystemDrive%\Program Files\WinRAR\WinRAR.exe" x <selection> *.* whereby the "selection" would be the full path and filename of the RAR file i want unpacking..... anyone know how to do this ? |
|
| Author: | w.a.y.n.e [ Sat Mar 16, 2013 7:36 am ] |
| Post subject: | Re: Classic Explorer - Custom Toolbar Button Help |
ok, from looking around i have discovered that... "%SystemDrive%\Program Files\WinRAR\WinRAR.exe" x %2 *.* works, however, if a file is not selected, then it still tries to extract from other files, such as the srr file, i have not tested yet with multiple different rar files in a folder as opposed to a set of rar files. swapping the x and %2 around fails when a specific rar file is selected, and returns archive not found message, which is exactly the opposite of what i want lol |
|
| Author: | Ivo [ Sat Mar 16, 2013 8:05 am ] |
| Post subject: | Re: Classic Explorer - Custom Toolbar Button Help |
If you want different behavior when nothing is selected, then you need some sort of a script. For example in a batch file you can check if the parameter is empty and not run rar. Also put quotes around %2 in case the file name has spaces. |
|
| Author: | w.a.y.n.e [ Sat Mar 16, 2013 8:07 am ] |
| Post subject: | Re: Classic Explorer - Custom Toolbar Button Help |
thanks for the quotes tip regarding spaces, going to do that now. been experimenting with winzip with this too, that behaves considerably differently, not least of which is i had to add an add-on for the command line stuff to work lol not sure about hte script, could you help with that ? |
|
| Author: | w.a.y.n.e [ Sat Mar 16, 2013 8:57 am ] |
| Post subject: | Re: Classic Explorer - Custom Toolbar Button Help |
actually, adding the quotes to the %2 seems to have done the trick, i'll need to experiment some more, like when i download a file set that has subs in separate rar file set. now it would be handy, if we could set 2 different command line scripts and have classi shell ask in the form of a drop down or popup which to activate, then i could set the buttons up with extract here or to folder options will experiment with multiple file selection too and see how that copes |
|
| Author: | w.a.y.n.e [ Sat Mar 16, 2013 10:57 am ] |
| Post subject: | Re: Classic Explorer - Custom Toolbar Button Help |
ok, so multiple file selection doesn't workm which is actually no proble, better like that. and adding the quotes to the %2 thing fixed it, and made it behave exactly as i wanted as for multi items on a drop down. if i create a false entry with no command, and then add to that the ones i want. and duplicate the buttons i can make it do what i want tlike that, so now just to determine the code for extract to same location, but in folder as per the archive name |
|
| Author: | Tenzen [ Sun Mar 17, 2013 2:24 am ] |
| Post subject: | Re: Classic Explorer - Custom Toolbar Button Help |
Cool, nice, it works.. though it doesnt delete the Archive.. and the right-click winrar menu is just as fast out of curiosity, are you doing this because WinRar menu disappeared? when I first installed Classic Shell, it broke my winrar menu completely, I had to download the latest x64 version of WinRar.. previously I've just used a 32-bit one.. but with Classic Shell (or maybe it was QTTab?) Winrar wont work, unless you have the newest 64-bit version of WinRar |
|
| Author: | Tenzen [ Sun Mar 17, 2013 2:27 am ] |
| Post subject: | Re: Classic Explorer - Custom Toolbar Button Help |
and you did good figuring that syntax out.. care to take a stab at notepad for me? I want to click on Notepad and have it place a New Text Document in the current folder, with the text "New Text Document" highlighted & ready for renaming... any idea on what kind of syntax might work for that? Currently I just got as far as typing: Notepad.exe New text Document whatever text you type after Notepad.exe will default to trying to save a new document in that location, but without any name there it all it just opens notepad in no location at all |
|
| Author: | w.a.y.n.e [ Tue Mar 19, 2013 5:01 pm ] |
| Post subject: | Re: Classic Explorer - Custom Toolbar Button Help |
I did it because i download quite a fair amount of file sets which i extract to the same folder and then select which files to keep, and then delete the rest, such as tv shows, and using the right click menu was getting to be a pain in the rear, i wanted a one click option. To delete files after extracting, i'd need to check, but i didn't see any command line code for that, i found the one to delete files after packing them into a RAR archive. Generally, i press CNTL and select the output file, the nfo file and the srr file if included, from my file set, then hit the Invert Selection button i have in the classic toolbar, and then delete, this removes all the files i don't want. no idea on the notepad thing, the only 2 things i could see for parameters/arguements were /p for pringing and the file name as you described above. The best i can suggest is you create a script or batch file that can do it ? or macro for right click then pressing w and t |
|
| Author: | Tenzen [ Wed Apr 17, 2013 10:55 am ] |
| Post subject: | Re: Classic Explorer - Custom Toolbar Button Help |
have you tried the DF switch to delete the archive after extraction? and do you know any way to extract the archive to a new folder of the same name? |
|
| Author: | Gurthfin [ Thu Apr 18, 2013 4:41 pm ] |
| Post subject: | Re: Classic Explorer - Custom Toolbar Button Help |
is posible to disable silent mode for %3 ? |
|
| Author: | Ivo [ Thu Apr 18, 2013 9:27 pm ] |
| Post subject: | Re: Classic Explorer - Custom Toolbar Button Help |
Maybe you can run a new CMD process, which should create a new console window. |
|
| Author: | Gurthfin [ Fri Apr 19, 2013 1:36 pm ] |
| Post subject: | Re: Classic Explorer - Custom Toolbar Button Help |
hm.. I am not very familiar with cmd. I programed litle utility (C++) to convert picture from bmp, jpg, dss etc to png.. call: C:\PicConv.exe %3 (silent mode). I try create new program Starter.exe, which send param %3 to PicConv.exe - system("C:\\PicConv.exe C:\Users\ADMINI~1\AppData\Local\Temp\cei682D.tmp"); but is still in silent mode. Batch file will work, but I dont know, how send %3 adress to batch file. (Sorry for my English) |
|
| Author: | Ivo [ Fri Apr 19, 2013 4:13 pm ] |
| Post subject: | Re: Classic Explorer - Custom Toolbar Button Help |
If you have a batch file and call it as "PicConv.bat %3", then %3 will become %1 inside the batch file (because it is the first parameter on the command line). In the batch file you can call PicConv.exe %1. |
|
| Author: | Gurthfin [ Fri Apr 19, 2013 8:17 pm ] |
| Post subject: | Re: Classic Explorer - Custom Toolbar Button Help |
nope, still silent mode... T_T. I try cout, cerr, system("@echo on"), but same result. |
|
| Author: | Gurthfin [ Wed May 01, 2013 4:50 pm ] |
| Post subject: | Re: Classic Explorer - Custom Toolbar Button Help |
are selected files (%3) sorted when are write to file (.tmp), or are ordered by mouse click? |
|
| Author: | Gaurav [ Thu May 02, 2013 9:39 pm ] |
| Post subject: | Re: Classic Explorer - Custom Toolbar Button Help |
No, the order in the temporary file created in %tmp% is the same as the order of the selected files. They are not sorted. |
|
| Author: | tingliu [ Fri Jun 28, 2013 2:14 am ] |
| Post subject: | Re: Classic Explorer - Custom Toolbar Button Help |
Cool, nice, it works.. _______________________________________________ WOW Gold|Wow Gold Kaufen|Aion Kinah|Diablo 3 Gold Kaufen |
|
| Page 1 of 1 | All times are UTC - 8 hours [ DST ] |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|