Page 1 of 2

Command-line in favorite files menu

Posted: 28 May 2014 09:50
by U_2582
Is it possible? I can't get it to work like in files associations.
Thanks

Re: Command-line in favorite files menu

Posted: 28 May 2014 09:55
by bdeshi
Go to "Tools-> List Management-> Favorite Files..."
click the button "New", paste the following:

Code: Select all

%WINDIR%\system32\cmd.exe
press "OK" and you're done.

Re: Command-line in favorite files menu

Posted: 28 May 2014 10:14
by U_2582
You didn't understand.
I need to pass command-line parameters to the target file.
Something like:

Code: Select all

"CMD - IP Config""%WINDIR%\system32\cmd.exe" ipconfig

Re: Command-line in favorite files menu

Posted: 28 May 2014 11:08
by sinilill
Why do you want it to be in the favorite files menu? I'm using a user button on the toolbar which loads a custom menu.
Passing command line parameters works just fine, some examples:

Code: Select all

"CMD - IP Config" run "cmd /c ipconfig & pause"

Code: Select all

"Weather" open """pdfxcviewtab\pdfxcview.exe"" /A ""page=1&view=FitH"" http://www.yr.no/place/Estonia/Harjumaa/Tallinn/forecast.pdf"""

Re: Command-line in favorite files menu

Posted: 28 May 2014 12:26
by bdeshi
by the target file, do you mean the currently selected file? The favorite files menu supports scripting, so his should be easy.

Re: Command-line in favorite files menu

Posted: 28 May 2014 13:09
by U_2582
Thanks alot sinilill,

I didn't know buttons and scripting could be so useful.

Thanks to everyone else too :)

Re: Command-line in favorite files menu

Posted: 28 May 2014 14:13
by klownboy
In case you are referring to running a program on the currently selected file. Here's another example using Image Magick to get all the info you ever wanted on a selected image file:

Code: Select all

"Image Magick Info|:meta" run "cmd /C """"D:\Graphics\ImageMagick\identify.exe"" -verbose ""<curitem>"" | clip""",,2,0; text "<clipboard>", 700, 900, "Image Magick Info";
and here's another using "IpConfig"

Code: Select all

"IP Configuration|:shellprops" run "C:\Windows\SysNative\cmd.exe /C ""C:\Windows\System32\ipconfig.exe /all"" | clip", ,0,0; text "<clipboard>", 700, 900, "IP Config",,;
These work as a Favorite File entry or they could be used in a CTB of course.

Edit: the run parameters above should be ... | clip", ,2,0 not | clip", ,0,0 see correction comments below

Re: Command-line in favorite files menu

Posted: 28 May 2014 14:18
by Stef123
U_2582 wrote:I didn't know buttons and scripting could be so useful.
For me it's the other way round: I didn't know the Fav-Files could be so useful. :roll:
But of course, if you can link to a PDF, why shouldn't you be able to link to an EXE as well. It just didn't occur to me to use it as a prog-launcher dropdown menu.

So I'd like to pick up the original question: Is there a way to pass parameters when calling an exe-file via the FavFiles Button?

Re: Command-line in favorite files menu

Posted: 28 May 2014 14:31
by klownboy
You posted right after me above Stef123 so maybe you didn't see it, but the first example I posted above is using parameters such as the currently selected file and passing it to a program. In this case it's also using "cmd". That example line or similar can be added to the Favorite Files menu via Tools | List Management.
Ken

Re: Command-line in favorite files menu

Posted: 28 May 2014 14:34
by Stef123
Thanks, klownboy. Got it.

Re: Command-line in favorite files menu

Posted: 28 May 2014 15:35
by sinilill
klownboy wrote:and here's another using "IpConfig"

Code: Select all

"IP Configuration|:shellprops" run "C:\Windows\SysNative\cmd.exe /C ""C:\Windows\System32\ipconfig.exe /all"" | clip", ,0,0; text "<clipboard>", 700, 900, "IP Config",,;
Nice, but on the first run it's always showing the clipboard content. On the second run it works, but when copying something new to the clipboard and run it, then it's showing again the clipboard content.

Re: Command-line in favorite files menu

Posted: 28 May 2014 15:49
by klownboy
sinilill, yes I noticed that myself earlier. Whereas, it never did that previously. I'm not sure what might have affected it. I was thinking it may be my use of ClipJump, the very nice AHK clipboard utility http://www.autohotkey.com/board/topic/9 ... ger/page-1 but I guess it isn't unless you use it too. I'll have to check it out. Maybe the clipboard has to be cleared. The other command line using Image Magick to obtain image file / photo info works fine.

If you run this in the Address Bar it works fine since it's sending it to a textfile, not using the clipboard [change the directory to suit].

Code: Select all

::run 'cmd /c "C:\Windows\System32\ipconfig.exe /all" > g:\downloads\ipinfo.txt' ,,2,0; run "notepad g:\downloads\ipinfo.txt",,2,1; delete 0,0,"g:\downloads\ipinfo.txt";

Re: Command-line in favorite files menu

Posted: 28 May 2014 16:09
by bdeshi
Try this:

Code: Select all

"IP Configuration|:shellprops" run "C:\Windows\SysNative\cmd.exe /C ""C:\Windows\System32\ipconfig.exe /all"" | clip", , 2,0; text "<clipboard>", 700, 900, "IP Config",,;
I think it's because you're using ... |clip",, 0, 0 instead of ...| clip",, 2, 0 . (wait for the program to copy the data and close before resuming the script)

edit:add missing words, reverse instead of args

Re: Command-line in favorite files menu

Posted: 28 May 2014 16:28
by klownboy
Thanks Sammay. I didn't notice that I had a "0" in there for the wait parameter in that example. I don't know how or why it got there. :) It was correct in the other example using Image Magick and the other IpConfig example which sends the output to a text file instead of the clipboard.
Thanks again,
Ken

Re: Command-line in favorite files menu

Posted: 04 Jun 2014 13:27
by sinilill
with the new runret command :D

Code: Select all

::text runret ("cmd /c ipconfig /all"), 720, 900, "IP Config",,;