Command-line in favorite files menu
-
U_2582
- Posts: 34
- Joined: 05 Oct 2013 10:33
Command-line in favorite files menu
Is it possible? I can't get it to work like in files associations.
Thanks
Thanks
-
bdeshi
- Posts: 4256
- Joined: 12 Mar 2014 17:27
- Location: Asteroid B-612
- Contact:
Re: Command-line in favorite files menu
Go to "Tools-> List Management-> Favorite Files..."
click the button "New", paste the following:
press "OK" and you're done.
click the button "New", paste the following:
Code: Select all
%WINDIR%\system32\cmd.exeIcon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
-
U_2582
- Posts: 34
- Joined: 05 Oct 2013 10:33
Re: Command-line in favorite files menu
You didn't understand.
I need to pass command-line parameters to the target file.
Something like:
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
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:
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
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 ]
[ this user is asleep ]
-
U_2582
- Posts: 34
- Joined: 05 Oct 2013 10:33
Re: Command-line in favorite files menu
Thanks alot sinilill,
I didn't know buttons and scripting could be so useful.
Thanks to everyone else too
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
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:and here's another using "IpConfig"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
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";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",,;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
For me it's the other way round: I didn't know the Fav-Files could be so useful.U_2582 wrote:I didn't know buttons and scripting could be so useful.
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
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
Ken
-
sinilill
- Posts: 111
- Joined: 02 Dec 2013 18:37
Re: Command-line in favorite files menu
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 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",,;
-
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
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].
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
Try this:
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
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",,;edit:add missing words, reverse instead of args
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ 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
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
Thanks again,
Ken
-
sinilill
- Posts: 111
- Joined: 02 Dec 2013 18:37
Re: Command-line in favorite files menu
with the new runret command
Code: Select all
::text runret ("cmd /c ipconfig /all"), 720, 900, "IP Config",,;
XYplorer Beta Club