Command-line in favorite files menu

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
U_2582
Posts: 34
Joined: 05 Oct 2013 10:33

Command-line in favorite files menu

Post by U_2582 »

Is it possible? I can't get it to work like in files associations.
Thanks

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Command-line in favorite files menu

Post 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.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

U_2582
Posts: 34
Joined: 05 Oct 2013 10:33

Re: Command-line in favorite files menu

Post 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

sinilill
Posts: 111
Joined: 02 Dec 2013 18:37

Re: Command-line in favorite files menu

Post 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"""

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Command-line in favorite files menu

Post by bdeshi »

by the target file, do you mean the currently selected file? The favorite files menu supports scripting, so his should be easy.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

U_2582
Posts: 34
Joined: 05 Oct 2013 10:33

Re: Command-line in favorite files menu

Post by U_2582 »

Thanks alot sinilill,

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

Thanks to everyone else too :)

klownboy
Posts: 4462
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: Command-line in favorite files menu

Post 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
Last edited by klownboy on 28 May 2014 16:32, edited 1 time in total.

Stef123

Re: Command-line in favorite files menu

Post 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?

klownboy
Posts: 4462
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: Command-line in favorite files menu

Post 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

Stef123

Re: Command-line in favorite files menu

Post by Stef123 »

Thanks, klownboy. Got it.

sinilill
Posts: 111
Joined: 02 Dec 2013 18:37

Re: Command-line in favorite files menu

Post 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.

klownboy
Posts: 4462
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: Command-line in favorite files menu

Post 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";
Last edited by klownboy on 28 May 2014 16:15, edited 1 time in total.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Command-line in favorite files menu

Post 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
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

klownboy
Posts: 4462
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: Command-line in favorite files menu

Post 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

sinilill
Posts: 111
Joined: 02 Dec 2013 18:37

Re: Command-line in favorite files menu

Post by sinilill »

with the new runret command :D

Code: Select all

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

Post Reply