It is currently Tue Apr 23, 2024 1:17 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  [ 18 posts ] 
Author Message
PostPosted: Sat Mar 16, 2013 7:24 am 
Offline

Joined: Sat Mar 16, 2013 7:08 am
Posts: 10
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 ?


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 16, 2013 7:36 am 
Offline

Joined: Sat Mar 16, 2013 7:08 am
Posts: 10
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


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 16, 2013 8:05 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 02, 2013 11:38 pm
Posts: 5333
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.


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 16, 2013 8:07 am 
Offline

Joined: Sat Mar 16, 2013 7:08 am
Posts: 10
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 ?


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 16, 2013 8:57 am 
Offline

Joined: Sat Mar 16, 2013 7:08 am
Posts: 10
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


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 16, 2013 10:57 am 
Offline

Joined: Sat Mar 16, 2013 7:08 am
Posts: 10
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 :) - so it was just that one little step i was missing !!

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 :)


Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 17, 2013 2:24 am 
Offline
User avatar

Joined: Thu Feb 21, 2013 11:04 pm
Posts: 470
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


Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 17, 2013 2:27 am 
Offline
User avatar

Joined: Thu Feb 21, 2013 11:04 pm
Posts: 470
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


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 19, 2013 5:01 pm 
Offline

Joined: Sat Mar 16, 2013 7:08 am
Posts: 10
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


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 17, 2013 10:55 am 
Offline
User avatar

Joined: Thu Feb 21, 2013 11:04 pm
Posts: 470
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?


Top
 Profile  
Reply with quote  
PostPosted: Thu Apr 18, 2013 4:41 pm 
Offline

Joined: Thu Apr 18, 2013 4:38 pm
Posts: 5
is posible to disable silent mode for %3 ?


Top
 Profile  
Reply with quote  
PostPosted: Thu Apr 18, 2013 9:27 pm 
Offline
Site Admin
User avatar

Joined: Wed Jan 02, 2013 11:38 pm
Posts: 5333
Maybe you can run a new CMD process, which should create a new console window.


Top
 Profile  
Reply with quote  
PostPosted: Fri Apr 19, 2013 1:36 pm 
Offline

Joined: Thu Apr 18, 2013 4:38 pm
Posts: 5
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)


Top
 Profile  
Reply with quote  
PostPosted: Fri Apr 19, 2013 4:13 pm 
Offline
Site Admin
User avatar

Joined: Wed Jan 02, 2013 11:38 pm
Posts: 5333
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.


Top
 Profile  
Reply with quote  
PostPosted: Fri Apr 19, 2013 8:17 pm 
Offline

Joined: Thu Apr 18, 2013 4:38 pm
Posts: 5
nope, still silent mode... T_T. I try cout, cerr, system("@echo on"), but same result.


Top
 Profile  
Reply with quote  
PostPosted: Wed May 01, 2013 4:50 pm 
Offline

Joined: Thu Apr 18, 2013 4:38 pm
Posts: 5
are selected files (%3) sorted when are write to file (.tmp), or are ordered by mouse click?


Top
 Profile  
Reply with quote  
PostPosted: Thu May 02, 2013 9:39 pm 
Offline
User avatar

Joined: Thu Jan 03, 2013 12:38 am
Posts: 5374
No, the order in the temporary file created in %tmp% is the same as the order of the selected files. They are not sorted.

_________________
Links to some general topics:

Compare Start Menus

Read the Search box usage guide.

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


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 28, 2013 2:14 am 
Offline

Joined: Fri Jun 28, 2013 2:12 am
Posts: 3
Cool, nice, it works..





_______________________________________________
WOW Gold|Wow Gold Kaufen|Aion Kinah|Diablo 3 Gold Kaufen


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

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 18 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.